Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setBatch should be exported to allow custom react backend #1790

Closed
maxired opened this issue Aug 5, 2021 · 3 comments
Closed

setBatch should be exported to allow custom react backend #1790

maxired opened this issue Aug 5, 2021 · 3 comments

Comments

@maxired
Copy link

maxired commented Aug 5, 2021

What is the new or updated feature that you are suggesting?

As a user of redux, I want to benefits from the use of batch, whatever react backend I am using.
In my case, I am using React-konva, which use react-reconciler from React fiber.
I whish I could call redux setBatch to provide the batchedUpdates function from the reconciler

Why should this feature be included?

Exporting the setBatch is easy to do, and would help lot of user of redux who care about performance.

Since react-redux is not supposed. to work only for react-dom and react-native, it make sense to open this benefits to all.

What docs changes are needed to explain this?

We would need to explain how setBatch works, and provide some example of using it

@markerikson
Copy link
Contributor

We do already have an alternate-renderers entry point that avoids importing batching from ReactDOM or React Native, specifically for use with other renderers. However, I don't think we actually export setBatch atm.

Seems reasonably doable in 7.2.x as well as 8.x.

@maxired
Copy link
Author

maxired commented Aug 5, 2021

thanks @markerikson for your answer.

In my case, I am also using react-dom for part of my app, so the import is not really an issue here. But thanks for pointing it, as I was not aware of it.

@markerikson
Copy link
Contributor

Given that React 18 now batches by default, I think this is OBE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants