How to get data in Cloud Firestore with React | Part 8 ReactJS Tutorial Series with Full App

↔️ ↕️


all right so in this video we're going

to continue off of the previous video


i have an eight answers page for

retrieving all of my

firebase firestore data so first i do


loading set loading is equal to use

state and the default value

is true and then i add in

another state variable const

posts comma set posts is equal to

use state which is a default value of an

empty array

and then i'm going to add in my use

effect hook

which is only going to run once

when i load my answers component which

in this case is a page

so i do uh const get posts

from firebase is equal to an empty array

Related queries:

how to get data from firestore in react native
reactjs fetch example
react fetch data example
react hooks fetch example
react hooks fetch data from api