react-native-svg: Error updating property 'strokeWidth' in RNSVGPath

Just updated RN to 0.50.4 and react-native-svg to 6.0.1-rc.0 and getting the following error

Error while updating property 'strokeWidth' in shadow node of type: RNSVGPath

TypeError: expected dynamic type 'double', but had type 'string'

the error comes from

StaticTransformConfig transformConfig = new StaticTransformConfig();
transformConfig.mProperty = property;
transformConfig.mValue = transformConfigMap.getDouble("value");

Any ideas, what causing it? The most I’ve used strokeWidth is in the following form strokeWidth="2"

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 29

Most upvoted comments

I have the same issue on Android only (iOS works fine) running react-native 0.50.4 and react-native-svg 6.0.1-rc1 with the following SVG:

<Svg height="35" width="35" viewBox="0 0 35 35">
<Path d="M25.30997,2.83092083 C22.9168541,1.47949378 20.1526344,0.708290378 17.2082904,0.708290378 C8.095592,0.708290378 0.708290378,8.095592 0.708290378,17.2082904 C0.708290378,26.3209888 8.095592,33.7082904 17.2082904,33.7082904 C26.3209888,33.7082904 33.7082904,26.3209888 33.7082904,17.2082904 C33.7082904,15.4394827 33.4299648,13.7356815 32.9147197,12.1382926" stroke="black" strokeWidth="2" fill="none" fillRule="evenodd" strokeLinecap="round"></Path>
</Svg>

Reverting back to react-native-svg 5.5.1 resolves the issue as well.

I don’t know how but after adding and linking an unrelated project, this started working for me on iOS. React-native development very often feels like trying to juggle sand.

@dustinsavery I can verify this happens on RN 0.50.4 and react-native-svg 6.0.0 . Reverting back to 5.5.1 resolves this issue.

I think you have to eject from expo if you want to change the react-native-svg version, as otherwise you cannot change the native build. Expo has a prebuilt version, which seems to be pre v6