We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input
wrong update of the state according to the react docs guide -> https://react.dev/reference/react/useState#updating-state-based-on-the-previous-Ifate
const [val, setVal] = useState() const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => { const { value: nextValue } = event.target const nextVal = { ...val, [valuePropName]: nextValue } setVal(nextVal) if (onChange) { onChange(event, addonBeforeProp || addonAfterProp ? nextVal : nextValue) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [addonAfterProp, addonBeforeProp, onChange, valuePropName])
setVal(curentObj => { const nextVal = { ...curentObj, [valuePropName]: nextValue } if (onChange) { onChange(event, addonBeforeProp || addonAfterProp ? nextVal : nextValue) } })
browser: not important node: 22 os: Mac
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The feature or bug you are proposing
Input
The description of the bug or the rationale of your proposal's
wrong update of the state according to the react docs guide -> https://react.dev/reference/react/useState#updating-state-based-on-the-previous-Ifate
A snippet of code for replicating the issue or showing the proposal usage if applicable
The expected result for your bug
Your environment
browser: not important
node: 22
os: Mac
The text was updated successfully, but these errors were encountered: