page not found react router dom code example

Example 1: react router catch all 404

<Switch>
   <Route path="/" exact component={Home}/>
   <Route path="/about" component={About}/>
   <Route component={Page404} />
</Switch>

Example 2: route with parameter react not working not found

<div>
    <Router history={browserHistory}>
        <Route path="/" component={NewCustomerContainer} />
        <Route path="/newCustomer" component={NewCustomerContainer} />
        <Route path="/search" component={SearchPageContainer} />
        <Route path="/network" component={NetworkMetaContainer}>
            <Route path="/:id" component={NetworkContainer}/>
        </Route>
    </Router>
</div>