Reputation: 275
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
Upvotes: 3
Views: 2609
Reputation: 427
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>
Upvotes: 4