Skip to content

Cannot read properties of null (reading 'getBoundingClientRect') #412

Discussion options

You must be logged in to vote

I fixed this issue.

"react-unity-webgl": "8.8.0"
Unity 2021

Component

import React, { useState, useEffect } from "react";
import Unity, { UnityContext } from "react-unity-webgl";
import styles from "./WebGLRenderer.module.scss";
import cn from "classnames";
import { Fragment } from "react";
// make sure to install 8.8.0 version of react-unity-webgl before importing this
const WebGLRenderer= ({ ...props }) => {
  // This is the context that Unity will use to communicate with the React app.
  const unityContext = new UnityContext({
    productName: "React Unity WebGL Tests",
    companyName: "Jeffrey Lanters",
    // The url's of the Unity WebGL runtime, these paths are public and should be…

Replies: 3 comments 8 replies

Comment options

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

@ShawnCentra
Comment options

@jeffreylanters
Comment options

@jeffreylanters
Comment options

@louis1999
Comment options

Comment options

You must be logged in to vote
2 replies
@louis1999
Comment options

@ShawnCentra
Comment options

Comment options

You must be logged in to vote
1 reply
@jack-szeto
Comment options

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