Skip to content

Updating to R3F v9 breaks applying Three.js class types for position, quaternion, etc. as props #3520

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

Open
EzraBrooks opened this issue Apr 24, 2025 · 0 comments

Comments

@EzraBrooks
Copy link

EzraBrooks commented Apr 24, 2025

Maybe this was a deliberate decision that I haven't been able to dig up (or I misunderstood) in the changelog, but upgrading to v9 caused a strange issue in my codebase: my tests that use @react-three/test-renderer started failing with the following error:

'TypeError: Cannot assign to read only property \'position\' of object \'#<Group>\'\n    at applyProps

I was baffled by this for a few hours since it seemed like position shouldn't be read-only.. Then eventually discovered that in this (simplified) case:

const position = new Vector3(1, 0, 0);
create(<mesh position={position}/>);

I got the error, but in this case:

create(<mesh position={[1, 0, 0]}/>);

I did not get the error.

If this is deliberate, I guess I just have to find all the places I directly apply a Vector3, a Quaternion, etc. into the ports of R3F JSX elements and break them out into these arrays, but it seems odd to me that the library wouldn't support this.

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