Skip to content

Commit

Permalink
fix: remove unnecessary memoization in <ConnectedRadio>
Browse files Browse the repository at this point in the history
  • Loading branch information
apostolos committed Jan 21, 2024
1 parent 0713713 commit 401c857
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/routes/customize/ConnectedRadio.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -22,8 +21,7 @@ interface ConnectedRadioProps extends Omit<Omit<RadioProps, 'onChange'>, 'checke

export const ConnectedRadio: React.FC<ConnectedRadioProps> = ({ 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) => {
Expand Down

0 comments on commit 401c857

Please sign in to comment.