Browse Source

fix: satisfy react doctor state updater rule

pull/11909/head
afc163 3 months ago
parent
commit
3546ec6025
  1. 2
      src/components/TagSelect/index.tsx

2
src/components/TagSelect/index.tsx

@ -71,7 +71,7 @@ const TagSelect: FC<TagSelectProps> & {
const value = props.value ?? innerValue; const value = props.value ?? innerValue;
const setValue = (nextValue: (string | number)[]) => { const setValue = (nextValue: (string | number)[]) => {
if (props.value === undefined) { if (props.value === undefined) {
setInnerValue(nextValue); setInnerValue(() => nextValue);
} }
props.onChange?.(nextValue); props.onChange?.(nextValue);
}; };

Loading…
Cancel
Save