-
-
Notifications
You must be signed in to change notification settings - Fork 493
Closed
Description
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
Every time a field value changes, onChange gets a new reference (and maybe other event handlers do as well).
What is the expected behavior?
When building a custom field and using useEffect, it's frequent to depend on onChange to update a value. In my case for a large field, I use useMemo to make sure I only rerender the parts that need it, but onChange makes sure everything gets updated every time the value changes. Is there another way than useCallback(input.onChange, [])?
Sandbox Link
https://codesandbox.io/s/react-final-form-third-party-components-example-lo4yo?file=/index.js
What's your environment?
(Latest on every lib, as seen on the sandbox)
Other information
/
Thanks in advance!
prevostc, Titozzz, afzalsayed96 and kapral18
Metadata
Metadata
Assignees
Labels
No labels