Disable unstable_batchedUpdates() on event handlers in React

Viewed 2067

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()
  })
}}>
1 Answers
Related