From 401c8579fbf72808c16391c94713adee538b3a6b Mon Sep 17 00:00:00 2001 From: Apostolos Tsakpinis Date: Sun, 21 Jan 2024 16:11:08 +0200 Subject: [PATCH] fix: remove unnecessary memoization in --- client/routes/customize/ConnectedRadio.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/routes/customize/ConnectedRadio.tsx b/client/routes/customize/ConnectedRadio.tsx index 1e68edaa..c9a32d2f 100644 --- a/client/routes/customize/ConnectedRadio.tsx +++ b/client/routes/customize/ConnectedRadio.tsx @@ -1,6 +1,5 @@ -import { useCallback, useMemo } from 'react'; +import { useCallback } from 'react'; import { useStore, useDispatch } from './store'; -import { createSelectorDeepEqual } from '~/services/selector'; import { Radio, type RadioProps } from '~/components/forms/Selection'; import type { BuildStore } from './types'; @@ -22,8 +21,7 @@ interface ConnectedRadioProps extends Omit, 'checke export const ConnectedRadio: React.FC = ({ name, value, options, action }) => { const selectedValue = useStore(value); - const radioSelector = useMemo(() => createSelectorDeepEqual(options, (d) => d), [options]); - const radios = useStore(radioSelector); + const radios = useStore(options); const dispatch = useDispatch(); const onChange: RadioProps['onChange'] = useCallback( (e, val: any) => {