Warning: Prop id did not match ERROR, unable load WEBGL Unity Game #482
-
Help! This is the error I'm getting, here's my code as well, I've followed the installation guide yet , can't load my unity webgl game. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The problem is caused by the internal hook
Perhaps a fix here is to provide the option to explicitly override the id on the Unity instance. Example: Also, thank you for building such a well documented library! |
Beta Was this translation helpful? Give feedback.
-
@xavieracaling @kristofferso @EricBlanchard I've added support for setting a custom canvas id in release v9.5.0. I've added further details to the React Unity WebGL Documentation. import React from "react";
import { Unity, useUnityContext } from "react-unity-webgl";
function App() {
const { unityProvider } = useUnityContext({
loaderUrl: "build/myunityapp.loader.js",
dataUrl: "build/myunityapp.data",
frameworkUrl: "build/myunityapp.framework.js",
codeUrl: "build/myunityapp.wasm",
});
return <Unity unityProvider={unityProvider} id="my-canvas-id" />;
} I'd love to hear your feedback, if you have any improvements or feedback - please let me know! Oh, and a happy new year! 🎉 |
Beta Was this translation helpful? Give feedback.
@xavieracaling @kristofferso @EricBlanchard I've added support for setting a custom canvas id in release v9.5.0. I've added further details to the React Unity WebGL Documentation.
I'd love to hear your feedback, if you have any improvements or feedback - please let me know! Oh, and a happy new ye…