Skip to content

Commit

Permalink
Merge pull request #12 from PhilippMolitor/dev
Browse files Browse the repository at this point in the history
release 2020.0.3
  • Loading branch information
Philipp Molitor authored Mar 6, 2021
2 parents a0054e5 + 7c0423e commit 68ed0c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-unity-renderer",
"version": "2020.0.2",
"version": "2020.0.3",
"description": "React Unity Renderer allows to interactively embed Unity WebGL builds into a React powered project.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion src/components/UnityRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ export const UnityRenderer: VFC<UnityRendererProps> = ({

// on context change
useEffect(() => {
// remove (previous) context if any
if (!context || context !== ctx) unmount();

// set new context
if (context) setCtx(context);
else unmount();
}, [context]);

// on mount
Expand Down

0 comments on commit 68ed0c6

Please sign in to comment.