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 557b604 commit a4ff725Copy full SHA for a4ff725
src/components/UnityRenderer.ts
@@ -135,8 +135,11 @@ export const UnityRenderer: VFC<UnityRendererProps> = ({
135
136
// on context change
137
useEffect(() => {
138
+ // remove (previous) context if any
139
+ if (!context || context !== ctx) unmount();
140
+
141
+ // set new context
142
if (context) setCtx(context);
- else unmount();
143
}, [context]);
144
145
// on mount
0 commit comments