brianzinn/create-react-app-typescript-babylonjs

Type error for boilerplate's App.tsx sphere's ref

Opened this issue · 1 comments

hi @jayypluss - it's a bit stricter in react 18. you need:

let sphereRef = useRef<Nullable<Mesh>>(null);

additionally on newer @babylonjs/core there is a side-effect you need to import if you are keeping the shadowgenerator:

import "@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent";