Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jayypluss opened this issue Sep 23, 2022 · 1 comment
Open

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

jayypluss opened this issue Sep 23, 2022 · 1 comment

Comments

@jayypluss
Copy link

jayypluss commented Sep 23, 2022

Type error for sphere's ref:
https://github.com/brianzinn/create-react-app-typescript-babylonjs/blob/master/src/App.tsx#L69

image

Uploading image.png…

brianzinn added a commit that referenced this issue Sep 23, 2022
@brianzinn
Copy link
Owner

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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants