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 5d3d9be commit b8a4272Copy full SHA for b8a4272
packages/node_modules/overmind-react/src/index.ts
@@ -88,12 +88,14 @@ export const createHook = <A extends Overmind<Configuration>>(overmind: A) => {
88
useEffect(
89
() => {
90
return () => {
91
- overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
92
- componentId: component.__componentId,
93
- componentInstanceId: overmindState.componentInstanceId,
94
- name,
95
- })
96
- overmindState.listener.dispose()
+ if (overmindState) {
+ overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
+ componentId: component.__componentId,
+ componentInstanceId: overmindState.componentInstanceId,
+ name,
+ })
97
+ overmindState.listener.dispose()
98
+ }
99
}
100
},
101
[component.__componentId]
0 commit comments