Home > Software design >  React - useState not reflecting the updated values
React - useState not reflecting the updated values

Time:02-05

I'm trying to bind a value typed by the user, in another input, which is readOnly, but it's reflecting in other input. Even though the value as I type, it can appear on html, but I'm unable to bind it to other input. Before I post this question, I already searched the SO to bind values, but most of them bind to html but not other input field, like my case

here is the codesandbox code which is causing trouble for me.

Edit laughing-lewin-4t7kv

CodePudding user response:

use setContactForm instead of mutating the state.

  •  Tags:  
  • Related