2

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
     />

"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}
/> 
4

1 回答 1

2

我使用 yarn remove react-native-svg 删除了项目中的版本,然后我运行了 yarn add react-native-svg@9.13

***解决了我的问题

于 2020-04-06T16:32:46.550 回答