Y
Y
youwereneverreallyhere2021-11-17 17:01:38
GitHub
youwereneverreallyhere, 2021-11-17 17:01:38

How to change the route rules of a single page React app to deploy to gh-pages?

I have a working single page application in react. It is required to transfer this application to gh-pages. For gh-pages, the application root looks like this https://name.github.io/repo/ The react application has various files. The logo for example is located here /config/images/logo.png When we run the application on gh-pages, this application does not see this logo because it expects to see it here https://name.github.io/config/images/logo. png and we have it here https://name.github.io/repo/config/images/logo.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Putin, 2021-11-17
@Ambi2Rush

For routing to gh-pages, you need to wrap the application in HashRouterinstead of BrowserRouter/ Router
Why and why is this needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question