JSON value '50' of type NSString cannot be converted to a YGValue
See original GitHub issueHi!
I’m using version 7.2.0 of react-native-svg. When doing something as simple as this:
<Rect height="50" width="1640.96" fill="#acd6ea" x="-232.39" y="-289.21" />
I get the following error: JSON value ‘50’ of type NSString cannot be converted to a YGValue. Did you forget the % or pt suffix? It seems like I need to specify height and width as follows:
<Rect height={50} width={1640.96} fill="#acd6ea" x="-232.39" y="-289.21" />
Is this really how it supposed to be? The readme file with instructions clearly tells that it should be a string, not and int.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
Percentage error: "JSON value of type NSString cannot be ...
Hi, Since upgrading to 0.10 with RN57, percentage values crash with the ... "JSON value of type NSString cannot be converted to a...
Read more >Error: JSON value of type NSstring cannot be converted of a ...
Sometimes i get this error: JSON value '8%' of type NSstring cannot be converted of a YGValue. Did you forget the % or...
Read more >iOS : JSON value of type NSString cannot be converted to a ...
... type NSString cannot be converted to a ABI38_0_0YGValue [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] iOS : JSON ...
Read more >Fixing an error: JSON value '1' of type NSNumber cannot be ...
After having upgraded React Native to 0.62.2, it got the following error: JSON value '1' of type NSNumber cannot be converted to NSString...
Read more >Json Value Of Type Nsstring Cannot Be Converted To A ...
I get the following error: JSON value '50' of type NSString cannot be converted to a YGValue. Did you forget the % or...
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
I was having issues where it wasn’t converting
NSString
toNSFloat
andNSNumber
. Many hours spent, many combinations of RNSVG and victory-native (what I was using it with), clean builds all along the way, and I even bumped from react-native 0.55.4 to 0.57.3. Nothing worked.I started screwing with the order of libraries in my xcode project and that seemed to fix it. One thing I remember doing specifically was putting
libPods
(as I have RNSVG installed through cocoapods) first in Linked Libraries and Frameworks.I’d recommend if anyone is having issues with value conversion that they toy with the order RNSVG is linked, or try using/not using cocoapods for installation. I think there’s something going on where another library I’m using is stomping on RNSVG’s expected
RCTConvert
imports/implementation.I got it working using the Xcode legacy build system