Answer the question
In order to leave comments, you need to log in
Components do not work at startup, how to fix it?
file:///D:/aa/dist/index.html I run the file, the green background appears, and my components in the route do not work, although everything works as it should in localhost: 8080 , what could be the reason?
<div className="game">
<Switch>
<Route exact path="/" component={Start} />
<Route path="/game" component={Game} />
<Route path="/finish" component={Finish} />
</Switch>
</div>
Answer the question
In order to leave comments, you need to log in
The file url protocol does not have a sub-path in the file. You cannot write D:\Dir\file.txt\ahaha\ in Windows, so routing cannot work there, except perhaps based on location.hash
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question