Open
Description
Please avoid duplicates
- I checked all open issues and discussions and none of them matched my problem.
Language and Compiler
TypeScript's built-in Compiler
What environment are you using?
Local Development Server
When does your problem occur?
When the Unity App starts
What does your problem relate to?
The problem seems Unity related
React-Unity-WebGL Version
9.0.0
React Version
18.0.0
Unity Version
2021.1
What happened?
When no width and height are provided, the canvas grows indefinitely.
Reproducible test case
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} />
);
}
Would you be interested in contributing a fix?
- yes, I would like to contribute a fix