You need to add your root path to the basename prop of BrowserRouter
If you are not using BrowserRouter, add the following
import BrowserRouter from 'react-router-dom/BrowserRouter'
ReactDOM.render((
<BrowserRouter basename={process.env.PUBLIC_URL}>
<App />
</BrowserRouter>
), ...)
process.env.PUBLIC_URL is is a part of the node.js library and is a dynamically generated url that changes based on what development mode you are in, whether you are working on your app locally, or on an actual production server like GitHub pages (https://parthaaaaa.github.io/firstwebapp/).
Also update the route to your home/firstwebapp component(if any)
<Route exact path='/firstwebapp' render= ... />} />
to
<Route exact path='/' render= ... />} />
With this change when the route path matches the ‘process.env.PUBLIC_URL’ (reponame + ‘/’) it will render your firstwebapp component