Closed NamalSanjaya closed 1 year ago
We have 2 different way to download images to Timeline.
I like this way
)
export default function ImgDownload(){
return <Image source={{uri: imgUrl}}/>
}
We fetch the image at the component mounting
export default function ImgDownload(){
const [dataUri, setDataUri] = useState("");
useEffect(() => { let reader = new FileReader(); reader.onload = function() { setDataUri(reader.result) }; (async () => { try { let response = await fetch(imgUrl); if (response.ok) { let blob = await response.blob(); reader.readAsDataURL(blob); return } console.log("get a error status code due to " + response.status); } catch (err) { console.log("could not fetch due to ", err) } })() },[])
return dataUri==="" ?
How to create Infinity Scrollbar with FlatList https://javascript.plainenglish.io/react-native-infinite-scroll-pagination-with-flatlist-e5fe5db6c1cb
Users able to see post/images shared by their friends. Timeline is the place where those will be appeared.(similar to Facebook News feed)