2

If we want to use an image in React-Native js from Images.xcassets, we simply provide the image name as URI - for eg.

<Image style = {styles.someStyle} source = {{uri:'addImage.png'}}> 

But what if we have a custom created .xcassets ? How can that imageset be accessed from the RN js ?

1 Answer 1

0

It's considered as legacy code, but can be imported like:

<Image source={require('image!custom')} />

Sign up to request clarification or add additional context in comments.

2 Comments

Downvote for what? This is part of the official RN documentation: facebook.github.io/react-native/docs/image.html
it's not working for me. Where did you find working example?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.