refactor: Use arrow function where possible (#3315)

This commit is contained in:
Lipis
2021-03-29 17:09:20 +03:00
committed by GitHub
parent bb568a9670
commit 722e5ca845
14 changed files with 24 additions and 26 deletions

View File

@@ -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 })}>