Trouble requiring image module in React Native

前端 未结 7 1953
别那么骄傲
别那么骄傲 2020-12-13 08:39

Just getting started with React-Native and I\'m having some trouble requiring a static image.

Here\'s the very-basic code I have so far:

\'use strict\'         


        
7条回答
  •  自闭症患者
    2020-12-13 09:10

    What version of React Native are you running? There was an issue with the packager, related to that, that have been solved.

    If that's the case, you can either update or run the dev server with:

    node_modules/react-native/packager/packager.sh --assetRoots path/to/Images.xcassets
    

    https://github.com/facebook/react-native/issues/282

提交回复
热议问题