In App.js of React, we can either:
<div className="App">
<Router>
<Switch>
<Route
path="/basics"
>
<BasicsPage></BasicsPage>
</Route>
// other routes
</Switch>
</Router>
</div>
OR
<div className="App">
<Router>
<Switch>
<Route
path="/basics"
component={BasicsPage}
>
</Route>
// other routes
</Switch>
</Router>
</div>
Just wondering which is the better way to write it and if there' any difference between the two? Thanks!