react-router-dom warning at route registration


I am registering a route with following code in react-router-dom

<Router basename="">
<div className="App">
  <Switch>
    <Route path='/reset-password' component={ResetpasswordNoAuth} />
    // other routes 
  </Switch>
</div>
</Router>

But I am getting following error with this code

index.js:1446 Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`.
    in Route (at App.js:64)
    in App (at src/index.js:12)
    in SnackbarProvider (at src/index.js:12)

No answers yet!

5 years ago by