summaryrefslogtreecommitdiff
path: root/src/components/ToggleSwitch.tsx
diff options
context:
space:
mode:
authorMatain <[email protected]>2022-06-12 23:34:56 +0800
committerMatain <[email protected]>2022-06-12 23:34:56 +0800
commitea5d7cf003eeef30cb7bbe789c6ba7f314bf1ce4 (patch)
treebff1bd7b0e8e8eb753d373b57f007bbe97f96c76 /src/components/ToggleSwitch.tsx
parent4fd2c8f646e48dd0c07d0c2041de52e9a4f8bc82 (diff)
parent38571da24ac54137564be5e41b7a409009e2ee10 (diff)
Merge branch 'master' of https://github.com/haishanh/yacd into haishanh-master
Diffstat (limited to 'src/components/ToggleSwitch.tsx')
-rw-r--r--src/components/ToggleSwitch.tsx5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/components/ToggleSwitch.tsx b/src/components/ToggleSwitch.tsx
index 9eb1019..58400c9 100644
--- a/src/components/ToggleSwitch.tsx
+++ b/src/components/ToggleSwitch.tsx
@@ -10,10 +10,7 @@ type Props = {
};
function ToggleSwitch({ options, value, name, onChange }: Props) {
- const idxSelected = useMemo(
- () => options.map((o) => o.value).indexOf(value),
- [options, value]
- );
+ const idxSelected = useMemo(() => options.map((o) => o.value).indexOf(value), [options, value]);
const getPortionPercentage = useCallback(
(idx: number) => {