I wanted to load custom URL when i load the react using npm start in create-react-app. By default it will open localhost:somePort/. But i need locahost:somePort/somestuff
Asked
Active
Viewed 2,514 times
1 Answers
4
How about just redirect from you app.js to the path you want? Like this:
import { BrowserRouter, Route, Redirect } from 'react-router-dom'
<BrowserRouter>
<Switch>
<Route
path='/'
component={SomeComponent}
/>
<Redirect to='/somestuff'/>
</Switch>
</BrowserRouter>

Akram Badah
- 417
- 3
- 12