Skip to content

Warning: Prop id did not match ERROR, unable load WEBGL Unity Game #482

Discussion options

You must be logged in to vote

@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 ye…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@EricBlanchard
Comment options

@kristofferso
Comment options

@EricBlanchard
Comment options

@jeffreylanters
Comment options

@kristofferso
Comment options

Comment options

You must be logged in to vote
1 reply
@kristofferso
Comment options

Answer selected by jeffreylanters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants