jeffreylanters / react-unity-webgl

React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.
https://react-unity-webgl.dev
Apache License 2.0
1.7k stars 160 forks source link

useCallback to useEffect #499

Closed sallf closed 1 year ago

sallf commented 1 year ago

Afaict, the documentation for how to dynamically update the device pixel ratio doesn't work.

handleChangePixelRatio is never called, so the eventListener is never created. I think this should be an effect, rather than a callback.

jeffreylanters commented 1 year ago

Hi Saylor. This was indeed documented incorrectly. Thanks for your contribution!