Replies: 2 comments 9 replies
-
I would definitely recommend this method if possible: https://shopify.github.io/react-native-skia/docs/getting-started/web/#using-defered-component-registration. |
Beta Was this translation helpful? Give feedback.
-
I was able to get your example working. Then the canvaskitwasm file in public was not up to date anymore with the installed version of Skia. This is a bit annoying but as long as expo use webpack 4, this is the only way to go. My recommendation is really to figure out how to do deferred component registration with storybook (this is how we do it in remotion for instance: https://github.com/wcandillon/remotion-skia-tutorial/blob/main/src/index.tsx#L10) and then be careful with upgrade. Be careful, keep your head cool, and you'll have a lot of fun with this setup I think :) |
Beta Was this translation helpful? Give feedback.
-
I am using storybook with react native, I usually test on iOS and also web.
Base on the guide for skia web, for web support
https://shopify.github.io/react-native-skia/docs/getting-started/web#loading-skia
I have to modify my webpack config but also I have to use
Using Code-Splitting
https://shopify.github.io/react-native-skia/docs/getting-started/web#using-code-splitting
Using Defered Component Registration
https://shopify.github.io/react-native-skia/docs/getting-started/web#using-defered-component-registration
Or even
Using a CDN
https://shopify.github.io/react-native-skia/docs/getting-started/web#using-a-cdn
Usually a story init would look like
Also my current webpack looks like:
Any advise of how to modify my webpack or my story to load components using skia correctly as a UI library on storybook?
Beta Was this translation helpful? Give feedback.
All reactions