reactjs - Failed context type: The context `router.push` is marked as required in `withRouter(t)`, but its value is `undefined` -
modules react-router , react-router both have version 4.2.2 . following react routing .
const history = synchistorywithstore(createbrowserhistory(), store); const headerwithrouter = withrouter(header); reactdom.render( <provider store = {store}> <router history = {history} > <section> <headerwithrouter/> <route = '/' = '/deals'/> <route exact path="/deals" component={deallist}/> <route path = "/deal" component={formdeal}/> <route path = "/admin" component={admin}/> <route path = "/mandate" component={mandate}/> <footer/> </section> </router> </provider> , document.getelementbyid('app'));
the thing not working <route = '/' = '/deals'/>
, warning - failed context type: context
router.pushis marked required in
withrouter(t), value is
undefined.
Comments
Post a Comment