Skip to content

Batching makes it difficult to perform imperative actions like focus #18402

Open
@astoilkov

Description

@astoilkov

React version: 16.9.5

Steps To Reproduce

  1. Overwrite batched updates with the following code: ReactDOM.unstable_batchedUpdates = callback => callback()
  2. Batched updates aren't actually overwritten.

Reasoning

I recognize that this may not be classified as bug because it isn't a documented feature but I have tried to search for a different solution but to no avail. Fixing this behavior can open a new way of using React. I tried writing on Stack Overflow and writing to @gaearon.

I have a number of arguments which support the disabling of batched updates in event handlers and in effects initialization. If anybody is willing to read a document and consider this scenario I am willing to write an RFC.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions