Cannot pass PlatformColor or DynamicColorIOS as fill prop
See original GitHub issueDescription
Hi,
I’ve been using the library for quite a while now, and I’m in the process of implementing Dark Mode on the app.
However, it seems that the transformer won’t accept fill
props with colors that came from the new PlatformColor or DynamicColorIOS React Native APIs.
Not sure exactly if the culprit is the transformer or the underlying SVGR.
Any ideas on how we can add support for these new color APIs?
Error logged
[Fri Nov 13 2020 20:04:35.610] WARN "[object Object]" is not a valid color or brush
G@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:123276:36
RNSVGSvgView
Svg@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:122985:36
SvgComponent
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to pass a color prop in React Native - Stack Overflow
Simple case. The only thing that you need to do is mark the property with color type, on IOS. RCT_EXPORT_VIEW_PROPERTY(myMagicColorProp, UIColor).
Read more >react-native-sfsymbols - npm
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] · Go to node_modules ➜ react-native-sfsymbols ...
Read more >types/react-native/index.d.ts - UNPKG
* A navigator is an object of navigation functions that a view can call. 2762, * It is passed as a prop to...
Read more >How to Manage Dynamic Fill with React Native Svg - ADocLib
However it seems that the transformer won't accept fill props with colors that came from the new PlatformColor or DynamicColorIOS React Native APIs....
Read more >https://cdn.jsdelivr.net/npm/@types/react-native@0...
The data arguments * emitted will be passed to the listener function. ... Either children or a render prop that receives a boolean...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, this workaround does not work with
PlatformColor
😢I’m not sure what you are doing exactly, but as a workaround something like this could be done: