Skip to content

Commit 445ce8b

Browse files
committed
Update both entry points to use the same set of exports
1 parent 9c12778 commit 445ce8b

File tree

4 files changed

+19
-31
lines changed

4 files changed

+19
-31
lines changed

src/alternate-renderers.js

-26
This file was deleted.

src/alternate-renderers.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export * from './exports'
2+
3+
import { getBatch } from './utils/batch'
4+
5+
// For other renderers besides ReactDOM and React Native,
6+
// use the default noop batch function
7+
const batch = getBatch()
8+
9+
export { batch }

src/exports.ts

-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ import { useDispatch, createDispatchHook } from './hooks/useDispatch'
2626
import { useSelector, createSelectorHook } from './hooks/useSelector'
2727
import { useStore, createStoreHook } from './hooks/useStore'
2828

29-
import { setBatch } from './utils/batch'
30-
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'
3129
import shallowEqual from './utils/shallowEqual'
3230

33-
setBatch(batch)
34-
3531
export * from './types'
3632
export type {
3733
ProviderProps,
@@ -55,7 +51,6 @@ export {
5551
connectAdvanced,
5652
ReactReduxContext,
5753
connect,
58-
batch,
5954
useDispatch,
6055
createDispatchHook,
6156
useSelector,

src/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export * from './exports'
2+
3+
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'
4+
import { setBatch } from './utils/batch'
5+
6+
// Enable batched updates in our subscriptions for use
7+
// with standard React renderers (ReactDOM, React Native)
8+
setBatch(batch)
9+
10+
export { batch }

0 commit comments

Comments
 (0)