How to use custom hooks in canvas child components , for example to access design tokens? #2112
-
Hi, I would like to use react-native-skia in an app I am working on, and the app has a light/dark theme with tokens. The theme is accessed via a hook to make sure it is up to date. When I try to use the hook in a component that is a child of the canvas, I get an error. I believe it is because Is there any idea how to work with that restriction? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is a library that allows you to access contextes from other renderer: https://shopify.github.io/react-native-skia/docs/canvas/contexts/#using-its-fine |
Beta Was this translation helpful? Give feedback.
There is a library that allows you to access contextes from other renderer: https://shopify.github.io/react-native-skia/docs/canvas/contexts/#using-its-fine
You can also do it manually