brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
821 stars 105 forks source link

fix: shouldn't put refs in a dependency array #263

Closed flyskywhy closed 1 year ago

flyskywhy commented 1 year ago

fix: ref to https://epicreact.dev/why-you-shouldnt-put-refs-in-a-dependency-array/

brianzinn commented 1 year ago

@flyskywhy thanks for the link - I think it was added to the dependency array just to make an eslint error go away, whereas an empty dependency array was working. Was that in React native that it wasn’t working for you?

flyskywhy commented 1 year ago

@flyskywhy thanks for the link - I think it was added to the dependency array just to make an eslint error go away, whereas an empty dependency array was working. Was that in React native that it wasn’t working for you?

Yes, you're right, react-native-babylonjs which I'm working on need this canvasReady state :stuck_out_tongue_closed_eyes:

And I think it will not affect original react-babylonjs, so be the PR.

brianzinn commented 1 year ago

thanks @flyskywhy - should work for you in v3.1.15.