How to deploy a React App on Firebase hosting

47 Views Asked by At

How to deploy a React App on Firebase hosting. When I use firebase init, it creates a "public" page and an "index.html" file but nothing appears when accessing the page after deployment. I put all the folders in "public" and fired firebase deploy, but it still didn't work.

enter image description here

1

There are 1 best solutions below

0
Uéslei Suptitz On

When firebase asks you which folder you want to use, don't use public, but build.

What do you want to use as your public directory? build

Configure as a single-page app (rewrite all urls to /index.html)? Yes

Reference: https://www.freecodecamp.org/news/how-to-deploy-a-react-app-with-firebase/