EXPO react-native-svg 错误:-“更新由 RNSVGPath null 管理的视图的属性“d”时出错。对于输入字符串:“c”

Dav*_*ars 4 svg react-native react-native-svg react-native-svg-charts

React-native-svg 和 android 似乎存在问题。此错误仅在我的Android应用程序中引发- iOS 应用程序似乎没问题?错误消息没有提示我可能发生错误的位置。任何想法都会有帮助...

代码:

import { Circle } from 'react-native-svg';

    <Circle
       cx="0"
       cy="0"
       r={size / 2 - 6}
       fill="rgba(255,255,255,0.7)" // Transparency
     />
Run Code Online (Sandbox Code Playgroud)

"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz", "react-native-svg": "9.5.3", "react-native-svg-charts": "^5.3.0",

在此输入图像描述

更新:

已经找到了错误的根源。其中node_modules>react-native-svg>elements>Path.js>Path>render需要一个道具“d” - 内容如下:

<RNSVGPath
 ref={this.refMethod}
 {...extractProps(propsAndStyles(props), this)}
 d={props.d}
/> 
Run Code Online (Sandbox Code Playgroud)

小智 5

我使用yarnremovereact-native-svg删除了项目中的版本,然后运行yarnaddreact-native-svg@9.13

***这解决了我的问题