From the course: React: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Upload progress

Solution: Upload progress

From the course: React: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Solution: Upload progress

(upbeat music) - [Instructor] I will now show you one way to implement the file upload progress feature. But first, let me start from a clean slate. Let me delete this. Head out to our browser, I can refresh, And now I'm back to the placeholder image. Head over now to profileimage.js we will add a new piece of state. This would be the upload progress. The initial value will be zero. Now above the button, we can add progress element here. Let's add some style, the width will be a 100 percent. Max value will be a 100. And the value would be the upload progress. Heading now to user.js, we can modify our upload image function to accept the new argument called progress, which will be a callback function that can be called with a snapshot information. We can actually use a second argument here, to get the snapshot information and call the progress call back with that snapshot. Back in the profile image component, we…

Contents