I am trying to disable unstable_batchedUpdates()
in React. I am starting to think it isn't possible. This is what I am trying:
ReactDOM.unstable_batchedUpdates = callback => callback()
I am searching for a solution which will help me avoid wrapping the code in event handlers with a setTimeout()
:
<div onClick={() => {
setTimeout(() => {
setInputVisible(true)
inputRef.current.focus()
})
}}>
I finally made progress with a conversation I had with Dan Abramov on GitHub. Posting the conversation here for reference: Batching makes it difficult to perform imperative actions like focus.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With