mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: Use arrow function where possible (#3315)
This commit is contained in:
parent
bb568a9670
commit
722e5ca845
14 changed files with 24 additions and 26 deletions
|
@ -1,4 +1,3 @@
|
|||
import React from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
export const ButtonIconCycle = <T extends any>({
|
||||
|
@ -14,11 +13,11 @@ export const ButtonIconCycle = <T extends any>({
|
|||
}) => {
|
||||
const current = options.find((op) => op.value === value);
|
||||
|
||||
function cycle() {
|
||||
const cycle = () => {
|
||||
const index = options.indexOf(current!);
|
||||
const next = (index + 1) % options.length;
|
||||
onChange(options[next].value);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<label key={group} className={clsx({ active: current!.value !== null })}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue