So I’ve an app with a most important web page that has 6 views. A few of them have CRUD performance. I’ve a video view the place the person can add a youtube hyperlink and the video can be uploaded to the view with a thumbnail after which the person can faucet it to go to the video. Similar goes for the Picture tab the place the person can add their very own photos from the gallery and create a slideshow throughout the Picture view.
I mainly take the media and use modals to render them to part tree. So I take the pictures and render them with a and I take the movies and render them with a
The difficulty I’m operating into is that when the person uploads the pictures/movies and goes again to the primary web page after which goes again to the Picture/Video view the pictures are now not there, they don’t save when rerouting.
How can I make it possible for is now not the case?
If it was internet I might hold the newly uploaded media to session storage however I’m not certain how to try this in React Native.
How do I make sure that this occurs?
This is the code for the picture view for context:
export default perform ImagePickerExample() {
const [images, setImages] = useState([]);
const [currentIndex, setCurrentIndex] = useState(0); // Observe present picture index
const pickImage = async () => {
let end result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Photos,
allowsEditing: true,
side: [4, 3],
high quality: 1,
});
if (!end result.canceled) {
setImages([...images, ...result.assets.map((asset) => asset.uri)]);
}
};
return (
<Pressable model={types.iconContainer} onPress={pickImage}>
<Picture
supply={require("../property/photos/upload_img.png")}
model={types.uploadButton}
/>
</Pressable>
<View>
{photos.size > 0 && (
<FlatList
horizontal
information={photos}
keyExtractor={(imageUri) => imageUri}
renderItem={({ merchandise, index }) => (
<Pressable
onPress={() => openModal(index)}
model={types.container}
>
<Picture supply={{ uri: merchandise }} model={types.picture} />
</Pressable>
)}
/>
)}
</View>
);