Answer the question
In order to leave comments, you need to log in
Why does URL change, React Router?
There is such a link: name.github.io/example, example is removed when entering the site, that is, from this one:
name.github.io/example
It turns into this:
name.github.io
I need what would happen when the page is refreshed was name.github.io/example.
Here is an example: an example , I went to the site: domen/taskreactive/, and when the page is updated, there is no page, because /taskreactive/ disappears
. problem?
router:
// импорты
import {
Route,
BrowserRouter as Router,
Switch
} from 'react-router-dom';
// разметка
<Router>
<div style={{ display: "flex", justifyContent: "center" }}>
<PageHeader />
<Switch>
<Route path="/profile">
<Profile />
</Route>
<Route path="/">
<NewUser />
<Home />
</Route>
</Switch>
</div>
</div>
</Router>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question