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

"Maximum update depth exceeded" when changing values #519

Open
d3ttl4ff opened this issue Sep 20, 2024 · 0 comments
Open

"Maximum update depth exceeded" when changing values #519

d3ttl4ff opened this issue Sep 20, 2024 · 0 comments

Comments

@d3ttl4ff
Copy link

Hi! I'm trying to use leva on my react-three projects but it throws this error when i try to change a value.
Screenshot 2024-09-20 134242

Here's a simple code I did

import { useControls } from 'leva';

const Base = () => {
 const { position, scale, color } = useControls({
   position: { value: { x: -2, y: 0 }, step: 0.01, joystick: 'invertY' },
   scale: { value: 1, min: 0, max: 5, step: 0.001 },
   color: '#ff0000',
 });

 return (
   <>
     <mesh position={[position.x, position.y, 0]} scale={scale}>
       <sphereGeometry />
       <meshStandardMaterial color={color} />
     </mesh>

     <mesh position-x={2} scale={1.5}>
       <boxGeometry />
       <meshStandardMaterial color="mediumpurple" />
     </mesh>

     <mesh position-y={-1} rotation-x={-Math.PI * 0.5} scale={10}>
       <planeGeometry />
       <meshStandardMaterial color="greenyellow" />
     </mesh>
   </>
 );
};

export default Base;

In my case it only happens on the position value changes. Scale, Color are working fine without an error. But whenever I try to move the object using the tweaks it throws the error and starts to lag with a significant framerate drop. Does anyone know why this is happening and any possible fixes?

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

1 participant