Good time of day. Tell me, please, what am I doing wrong.
Created the project using the create-react-app, used react router.
Locally everything works fine and shifts as it should.
Configured
<Switch>
<Route path="/" exact component={Home} />
<Route path="/messages" component={Messages} />
<Route path="/notification" component={Notification} />
<Route path="/settings" component={Settings} />
</Switch>
The links themselves are so
<NavLink to="/">Link</NavLink>
<NavLink to="/messages">Link</NavLink>
<NavLink to="/notification">Link</NavLink>
<NavLink to="/settings">Link</NavLink>
Filled on the server in a subfolder
domain.ru/works/project-name
In package.json has prescribed "homepage": "
domain.ru/works/project-name"
All is well loaded, but.
1) load the component Home which should be loaded by default, other links work.
2) If you change the first route to
<Route path="" exact component={Home} />
the loaded component Home but stop working other links
The address in the address bar when you click change
domain.ru/notification or other name of the component, although should be changed to "
domain.ru/works/project-name/notification" and refreshing the page I do not get the page where you were.
Where did I go wrong and what's wrong with ordered?
Thank you.