Html <canvas> does not resize correctly with the window
Description
React native skia <Canvas> on web ultimately renders to a html <canvas> inside a <div>. The div is resized when the browser window resizes but the <canvas> is not.
Here is an example: my <Canvas> was originally 500x714, that lead to a 1000x1428 <canvas>. When I shrink the window size, <div> gets resized, but <canvas> remains at 1000x1428.
I think this is due to: https://github.com/Shopify/react-native-skia/blob/45ae9cb3f1067b51958f2f1cdaa95a2ecd33f4de/package/src/views/SkiaBaseWebView.tsx#L47 here we are reusing original canvas.clientWidth rather than the width / height from the layout event. Is there a reason not to?
Version
1.2.3
Steps to reproduce
- create a simple web app with <Canvas>
- open element inspector from developer tools, find the html <canvas>
- resize the browser
- observe <canvas> does not change size
Snack, code example, screenshot, or link to a repository
Here is https://github.com/Shopify/react-native-skia/blob/45ae9cb3f1067b51958f2f1cdaa95a2ecd33f4de/package/src/views/SkiaBaseWebView.tsx#L47