为什么它向我显示此错误?
我有一个使用 npx react-native init myProyect 创建的应用程序,该应用程序是在我的 React Native 工作室中创建的。
我正在测试使用“styled-components / native”添加样式的方法。
我想展示不同的公司,包括它们的名称、地址、公司类型的图标、公司形象和评级星级。
我为星星添加了 svg 图像。对于公司图片,出于测试目的,我已通过 URL 添加了它,但我想从资产文件夹中添加图片,但我不知道该怎么做。
到目前为止,您可以看到公司图像、星星和 CLOSE 图像,该图像也是 svg,我从文件中获取它。当我尝试添加图标以显示公司的类别时,该图标未显示,尽管运行应用程序,控制台仍显示以下错误:
LOG Running "searchYourBusiness" with {"rootTag": 121}
ERROR Warning: Each child in a list should have a unique "key" prop.
Check the render method of `StoreInfo`. See https://reactjs.org/link/warning-keys for more information.
SvgXml @ http: //10.0.2.2: 8081 / index.bundle? Platform = android & dev = true & minify = false & app = com.searchYourBusiness & modulesOnly = false & …
Run Code Online (Sandbox Code Playgroud)