React slow with multiple controlled text inputs
There are many possible reasons for this to happen. I faced the similar issue and filtered the main cause to:
- Large State, so it takes up sometime
- React Dev Tool / Use of non minified react
- Mutating state data
Whatever may be the reason, I found a quick fix for this. If you just want to store it to the state but not using it for live rendering. Then you can safely replace the 'onChange' to 'onBlur'. This has no dealay and lag. If you know any other case where this will not work, do let me know!
Change the code as follow:
<label>Event Name</label>
<input
type="text"
placeholder="Title"
className="form-control"
name="title"
value={this.state.event.title}
onBlur={this.handleChange} />
I had a similar situation and my solution was to disable React Dev Tools. They were affecting input fields somehow. The problem is it's not enough to refresh a page if you have clicked React Dev Tools tab. They are still affecting your inputs. You have to open new page to stop them. You can also remove them from Chrome completely but I don't recommend doing this 'cause they are useful. :)