-
Notifications
You must be signed in to change notification settings - Fork 18
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
svgs component cannot receive the style created by StyleSheet in web #39
Comments
Thanks for taking the time to report and thoroughly describe the issue. So just to be clear here, the issue is compatibility with React-Native-Web, as it using the React-Native pattern for styles for web, instead of returning actual object as expected by React it returns numbers. We don't use React-Native-Web at all, so this is low priority issue for us. It's an issue nonetheless. What I do I provide you with a decent work around until a PR is made, or contributed. As stated in the proposals and discussions repository of React-Native:
There is absolutely no benefit of using the Stylesheet API vs passing regular objects. So I would suggest stop using the StyleSheet API, use regular objects, and everything will work on React-Native as well as normal React (even without React-Native-Web). |
Thanks for your response and sharing the proposals and discussions issue.👍 I read the issue, FB commented:
According from the comment, it has benefit for using StyleSheet API even though the performance section was removed from the StyleSheet docs. I understood the stance to the issue and priority for you. I'll look for a workaround or use passing regular object partially about If the issue is bothered you, please close the issue. |
Overview
svgs
's component can't receive style created by StyleSheet.create() in web.Details
I'm developing an application with react-native and react-native-web.
react-native-web is porting react-native's implementation as much as possible.
So, StyleSheet.create() return object style key and id like following.
react-native-web resolve all styles in it's components.
https://github.com/necolas/react-native-web/blob/9872c9716973870ab3cc129215a17fc6cbb1b112/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js
Actual Behavior
Throws Error of following and nothing to render.
Expected Behavior
Correctly svg rendered.
Reproduction repository
https://github.com/sasurau4/sample-rnweb/tree/repro/svgs-issue
I think this is edge case. But if this issue fixed, svgs fully compatible to the react-native-svg.
Thanks in advance.
The text was updated successfully, but these errors were encountered: