-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native support? #26
Comments
Yes, use react-native-canvas instead of svgcanvas. This is a good tutorial: https://www.atomlab.dev/tutorials/react-native-canvas |
Thanks for your response, Arjun. I found react-native-svg is a good solution for my use case. I am generating screens with a mixture of text and vector graphics, and I need the ability to pan and zoom with crisp rendering at any scale. It turns out that converting SVG to JSX is straightforward, and the viewport provides pan and zoom. My one remaining stumbling block is how to wrap text in boxes. This is trivial when using components and styles, but I haven't found a good SVG solution. |
This may not be the answer you're looking for, but wrapping your text in a view component and styling it with a border might work. |
Unfortunately no - SVG and CSS rendering are two different universes right now. I believe I'm going to have to find or create an algorithm for wrapping text. As an experiment, and potentially as part of the solution, I did find a way to measure text width. Bit of a kludge, but it works. |
|
The example does not work in React Native because the document object is not available. Is there a workaround?
Code:
Error:
Versions:
The text was updated successfully, but these errors were encountered: