4 ms·
I've never experienced that. Mind sharing an example?
by symboltoproc 8y ago
I've never experienced that. Mind sharing an example?
- bestest 8y agoThat would happen when, for example, you're saving the value of the text input in redux, and the input is then updated with that value on change, although it's also updated by the user typing and the thread is blocked at the same time, thus we have a race condition. That said — it only happens when one over-engineers stuff. Make sure to have a single source of truth, and that will be avoided.
- deleted 8y ago[deleted]
- philipp-spiess 8y agoThe best approach is to always updated the input synchronously in React (in the same tick when the event is handled). If you do it in another tick, you will always have to handle race conditions. This is a problem for all input elements though, not specific to React or even the Web.
- nkg 8y agoThe last time I experienced it I was using search bar on AliExpress.com's mobile website