-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add SvgXml for web #1686
base: develop
Are you sure you want to change the base?
Add SvgXml for web #1686
Conversation
Any chance to expedite the merging of this pull request? Without it, SvgUri is not working with Webpack right now. |
Also waiting for this to be merged so we can update a package. Thanks so much for the PR @Sharcoux and all the work team |
For everyone reading this thread:
|
@Sharcoux Thanks for the fork. When I try to use it as a drop in replacement, I get the following error:
And:
|
@localjo feel free to open issues there. I'll have a look. But from what I see, you didn't install the peer dependencies as dependencies of your project: "peerDependencies": {
"react": "*",
"react-native": ">=0.50.0",
"react-native-web": ">=0.14.0"
}, Unless a change in recent version broke the fork. In this case, in the issue you will create, show me your versions of those 3 libs |
@Sharcoux I don't think that's the issue. I have the following in my dependencies:
|
Maybe some inner implementation changed in react-native-web 18. I still encourage you to open an issue on the @cantoo/rn-svg project. It will be easier to follow up there. |
Signed-off-by: François BILLIOUD f.billioud@gmail.com
Summary
Explain the motivation for making this change: here are some points to help you:
This solves this issue: #1279
It enables to have a common API for RN and RNWeb
I used the code of View from react-native-web as a basis, parsed the svg provided as an
xml
prop, and finally created a svg tag with support for React-Native style, and handling all react-native props like onLayout, measure, or gesture events.It should not have any impact on the existing project. Though, react-native-web needed to be added within the optionalDependencies, but as it is called in a .web.ts file, it should not create any trouble.
Test Plan
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Currently in progress. But when done, You should just run:
npm run web
What's required for testing (prerequisites)?
npm i
What are the steps to reproduce (after prerequisites)?
Compatibility
Checklist
README.md
__tests__
folder