How to implement _default_ or _NotFound_ page?
A <Switch>
renders the first child <Route>
that matches. A <Route>
with no path always matches. So you just need to simply drop path attribute as below
<Switch><Route exact path="/" component={Home} /><Route path="/user" component={User} /><Route component={NotFound} /></Switch>
September 26, 2022
1304
Read more
What is React?
November 06, 2022
ReactJSHow to programmatically trigger click event in React?
November 06, 2022
ReactJS