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.75k stars 162 forks source link

Fix matchWebGLToCanvasSize not setting to false #511

Closed leomav closed 1 year ago

leomav commented 1 year ago

In this PR we try to fix a matchWebGLToCanvasSize issue. This prop was always set to true event if we set it to false via . That's because in /hooks/use-unity-arguments.ts the matchWebGLToCanvasSize was being set with an OR operator which was always resulting to true. Here is a screenshot of the only in-code change applied. By checking if the type is boolean we make sure that no other types like 'string' or 'undefined' are coming in, but if so, true should be the default value.

Screenshot 2023-05-29 at 5 05 12 PM
leomav commented 1 year ago

@jeffreylanters Sorry for that, i updated the PR cause I hadn't sing my commits :)

leomav commented 1 year ago

@jeffreylanters finally managed to add verification correctly this time. Sorry for wasting time, that was the first time doing that.

jeffreylanters commented 1 year ago

Hi Leonidas! Thank you for your pull request. Very sharp, this was indeed unintended behaviour. I'll merge it right away. 🦾