We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b69c8ac commit dd0a0b9Copy full SHA for dd0a0b9
packages/node_modules/overmind-react/src/index.ts
@@ -1,6 +1,6 @@
1
import {
2
IConfiguration,
3
- IContext,
+ MODE_SSR,
4
EventType,
5
Overmind,
6
OvermindMock,
@@ -86,6 +86,16 @@ export const createHook = <Config extends IConfiguration>(
86
const overmind = (overmindInstance || useContext(context)) as Overmind<
87
Config
88
>
89
+
90
+ if ((overmind as any).mode === MODE_SSR) {
91
+ return {
92
+ state: overmind.state,
93
+ actions: overmind.actions,
94
+ effects: overmind.effects,
95
+ addMutationListener: overmind.addMutationListener,
96
+ }
97
98
99
const component = useCurrentComponent()
100
const name = component.name
101
component.__componentId =
0 commit comments