React-hook-form: Watching a select form does not watch value continuously

Created on 14 Jun 2019  路  3Comments  路  Source: react-hook-form/react-hook-form

...In a form where a user can choose from a dropdown select, and given the option selected, the system needs to "hide/disable" or "show/enable" another form element.

It seems that watching for single fields (in this case, the select element), it only watches the first selection change and not continuously?

To Reproduce
go to this sandbox:
https://codesandbox.io/s/react-typescript-yqx5f

Expected behavior
the watcher should trigger every time the user changes selection on the dropdown selector so that the system can show/hide the other form element accordingly.

bug

All 3 comments

@bjeld thanks for report the bug, fixed with 3.11.2

https://codesandbox.io/s/react-typescript-j1qig

well, that was fast :)
Amazing library to work with. Keep up the awesome work

@bjeld thanks very much for your support 馃憤

Was this page helpful?
0 / 5 - 0 ratings