Welcome to the React feedback portal. We’re happy you’re here! If you have feedback on how to improve the React, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi,
I'm using React Hook Form to manage form state and I had some odd behaviour with the CheckBoxComponent where the checked prop is managed state. I've created a stripped down example that just uses "useState" instead of React Hook Form which exhibits the same behaviour.
So basically if the value of the "checked" prop for the CheckBoxComponent is maintained as state and the change callback prop is passed in to update that state then clicking interactively on the control results in the visual check on the control correctly changing on the first click but the hidden input doesn't, and then on subsequent clicks the two toggle but are always displaying the opposite. Updating the state from an external event (i.e. a button) doesn't exhibit the same behaviour, it's just when clicking on the control to change its state where the issue arises.
See my example here where I've used CSS to force the hidden input to be shown to the right.
So perform the following steps: