I am attempting to add a functionality where users can select a profile pic from their mobile gallery and set it. For this, i am using react native and nodejs. I successfully upload a file to s3 using nodejs, get a URL and store that URL in the database as the users profile pic. I now need to do the front end, and i am really struggling with this. How would load the URL in react native so the profile pic is visible. Thank you.
2 Answers
Very easy:
import {Image} from 'react-native';
<Image
style={{width: 300, height: 300}}
source={{uri: _urlOfImage}} />
2 Comments
Ninja077
Hey friend. Thank you so much but one thing. I have implemented upload in node(my backend) and get the url from there, so.how would i know what the upload url is. If a user selects an image how do i get the url from the backend?
Ninja077
How would i get the url of an image the user uploaded, when i have the url in the backend ?