We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0054e5 + 7c0423e commit 68ed0c6Copy full SHA for 68ed0c6
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "react-unity-renderer",
3
- "version": "2020.0.2",
+ "version": "2020.0.3",
4
"description": "React Unity Renderer allows to interactively embed Unity WebGL builds into a React powered project.",
5
"main": "./dist/index.js",
6
"types": "./dist/index.d.ts",
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