You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explanation
I am getting these two typescript errors concerning valtio readonly types with position property of elements in react-three-fiber. From my understanding, react-three-fiber components should accept readonly types since the library doesn't mutate the values. I can be wrong, so please let me know how this was intended to work.
The position ={point0} will give off the following error The type 'readonly [number, number, number]' is 'readonly' and cannot be assigned to the mutable type '[x: number, y: number, z: number]'
The points={[point0, point1, point2]} will give off the following error Type 'readonly [number, number, number]' is not assignable to type 'Vector3 | [number, number, number]'.ts(2322)
The text was updated successfully, but these errors were encountered:
Explanation
I am getting these two typescript errors concerning valtio readonly types with position property of elements in react-three-fiber. From my understanding, react-three-fiber components should accept readonly types since the library doesn't mutate the values. I can be wrong, so please let me know how this was intended to work.
First example
The
position ={point0}
will give off the following errorThe type 'readonly [number, number, number]' is 'readonly' and cannot be assigned to the mutable type '[x: number, y: number, z: number]'
Second example
The
points={[point0, point1, point2]}
will give off the following errorType 'readonly [number, number, number]' is not assignable to type 'Vector3 | [number, number, number]'.ts(2322)
The text was updated successfully, but these errors were encountered: