-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2062 from reduxjs/pr/exports-rsc
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type * as normal from './index' | ||
import type * as rsc from './index-rsc' | ||
|
||
// checks to make sure we didn't forgot to replicate any exports | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const _check: typeof normal = {} as typeof rsc | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const _check2: typeof rsc = {} as typeof normal | ||
|
||
// ------------------------------------------------------------------------------------- | ||
|
||
function throwNotSupportedError( | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
...args: any[] | ||
): any { | ||
throw new Error( | ||
'This function is not supported in React Server Components. Please only use this export in a Client Component.' | ||
) | ||
} | ||
|
||
export { | ||
throwNotSupportedError as batch, | ||
throwNotSupportedError as Provider, | ||
throwNotSupportedError as connect, | ||
throwNotSupportedError as useSelector, | ||
throwNotSupportedError as useDispatch, | ||
throwNotSupportedError as useStore, | ||
throwNotSupportedError as createDispatchHook, | ||
throwNotSupportedError as createSelectorHook, | ||
throwNotSupportedError as createStoreHook, | ||
} | ||
export const ReactReduxContext = {} as any | ||
export { default as shallowEqual } from './utils/shallowEqual' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters