leva
leva copied to clipboard
Vector2 | Cannot read properties of null (reading 'style')
Hi, click Joystick
playgroundRef.current.style.left = left + width / 2 + "px"; // playgroundRef.current is null
playgroundRef.current.style.top = top + height / 2 + "px";
https://github.com/pmndrs/leva/assets/11176223/fcaa2d01-a25f-40da-ad93-780dffebc24c
package.json
{
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/roboto": "^5.0.13",
"@mui/material": "^6.0.0-alpha.11",
"leva": "^0.9.35",
"react": "19.0.0-rc-e684ca66ab-20240619",
"react-dom": "19.0.0-rc-e684ca66ab-20240619",
"react-fps": "^1.0.6"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
}
}