reduxjs / react-redux

Official React bindings for Redux
https://react-redux.js.org
MIT License
23.38k stars 3.36k forks source link

Docs: Document "alternate renderers" entry point #1458

Open markerikson opened 5 years ago

markerikson commented 5 years ago

In v7, we added a hard dependency on either react-dom or react-native, because we need to pull in unstable_batchedUpdates. For those users who happen to not be using RD or RN, we added an "alternate renderers" entry point that drops the batching.

This entry point was described in the v7 release notes at https://github.com/reduxjs/react-redux/releases/tag/v7.0.1 , but we do not have it formally documented. We should add some kind of a usage guide page for using RR with other renderers.

This came up in #1457 .

NickHeiner commented 4 years ago

Good to see this is already supported! I'll be using this for the Netflix TV app, which uses an alternate renderer that works with our smart TV platform.

NickHeiner commented 4 years ago

In alternate-renderers, I see:

// For other renderers besides ReactDOM and React Native, use the default noop batch function
const batch = getBatch()

I'd actually like the ability to pass in my own batch function. Would you accept a PR for that?

markerikson commented 4 years ago

Hmm. Can we do that by exporting whatever internal setBatch function we already have?

NickHeiner commented 4 years ago

That's what I was planning to do. 😄