React-native: How a Image component showing by a absolute local path

Created on 15 Apr 2016  Â·  8Comments  Â·  Source: facebook/react-native

I developed a customized image component to download the online image and saved to a local file. I can not find a way to show this local file by Image component. I am sure these file downloaded successfully, because I can open them. I have tried the following ways:

1)

<Image source={{isStatic:true, uri:'file:///Users/jay/Library/Developer/CoreSimulator/Devices/00520C5F-1307-427E-AA55-9E1E020B2EFB/data/Containers/Data/Application/522D5404-A2EF-4117-A768-CF63A6A3EE8F/Library/Caches/6ea32f8825c207ec582ad684ac6a3494'}} style={imageStyle} />

2)

<Image source={{isStatic:true, uri:'/Users/jay/Library/Developer/CoreSimulator/Devices/00520C5F-1307-427E-AA55-9E1E020B2EFB/data/Containers/Data/Application/522D5404-A2EF-4117-A768-CF63A6A3EE8F/Library/Caches/6ea32f8825c207ec582ad684ac6a3494'}} style={imageStyle} />

Ran Commands Locked

All 8 comments

@facebook-github-bot stack-overflow

Hey @jaynsw and thanks for posting this! @charpeni tells me this issue looks like a question that would be best asked on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO.

My example is from stackoverflow. I also read a github project named react
native image cache. None of them work.
I Think this should be put in official document if there is a way
On 16 Apr 2016 12:31 AM, "Nicolas Charpentier" [email protected]
wrote:

@facebook-github-bot https://github.com/facebook-github-bot
stack-overflow

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/facebook/react-native/issues/6998#issuecomment-210483536

I don't believe stackoverflow is the best place for this question because
this looks like a new feature being requested or a missing document for a
popular feature. Anyway if you want to be peaceful just neglect my point.
On 16 Apr 2016 12:38 AM, "Facebook Community Bot" [email protected]
wrote:

Hey @jaynsw https://github.com/jaynsw and thanks for posting this!
@charpeni https://github.com/charpeni tells me this issue looks like a
question that would be best asked on StackOverflow
http://stackoverflow.com/questions/tagged/react-native. StackOverflow
is amazing for Q&A: it has a reputation system, voting, the ability to mark
a question as answered. Because of the reputation system it is likely the
community will see and answer your question there. This also helps us use
the GitHub bug tracker for bugs only. Will close this as this is really a
question that should be asked on SO.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/facebook/react-native/issues/6998#issuecomment-210485798

In fact, i'm totally agree with you and i'm wondering the same question as you.

However, as mentioned in the issue template this repo uses GitHub for bugs and StackOverflow for usage question. Feature requests can be post on Product Pains.

Please feel free to ask it on StackOverflow and post the link in this issue. After that with a good answer we'll be able to update the documentation.

@jaynsw did you manage to figure out how to do this ?

The url format should be same as other iOS and Android App. I suggest you
can setup a break point in cameraroll example of UIExplorer to look into it.
Jay

On 19 Dec. 2016 3:24 am, "Salman Hasrat Khan" notifications@github.com
wrote:

@jaynsw https://github.com/jaynsw did you manage to figure out how to
do this ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/6998#issuecomment-267830472,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZBPoRE_i85AI_uEdnQaPINIVpt3XuXks5rJV42gaJpZM4IIXgP
.

At least on iOS I had to add an '.png' to my local file when it did not contain a suffix.

Was this page helpful?
0 / 5 - 0 ratings