react-postprocessing icon indicating copy to clipboard operation
react-postprocessing copied to clipboard

Selection causes endless loop

Open yunusyuksel opened this issue 1 year ago • 3 comments

Using selection API causes the child components stuck in endless loop

<Selection> <Select enabled> <mesh position={[5, 5, 0]}> <boxGeometry /> <meshStandardMaterial color="orange" /> </mesh> </Select> </Selection>

yunusyuksel avatar Jan 29 '24 13:01 yunusyuksel

Any updates on this? I'm using the latest rc (3.0.0-rc.2) As long as Select enabled is true it causes endless updates.

BabakMot avatar Jan 31 '25 01:01 BabakMot

I'm not an expert in React or this library, but the bug seems to be in this code. api.select calls a setState which causes the component to re-render calling the cleanup for the effect, which remove the object from the selection, and it's added back in when the effect reruns, etc.

tsherif avatar Jun 03 '25 16:06 tsherif

I am using 3.0.4 and it is still causing an endless update loop in react.

guru-florida avatar Jun 30 '25 18:06 guru-florida