Archives : November-2018

I am trying to test a react component using jest and enzyme. But whenever i try to mount the component, i am getting following error. Error: Uncaught [SecurityError: replaceState cannot update history to a URL which differs in components other than in path, query, or fragment.] at reportException (node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24) at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:209:9) at HTMLUnknownElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9) ..

Read more

I am building a project with react-router that has multiple routes. The code looks like this: <Router> <div className=’main’> <Header /> <div className=’main-content’> <Switch> <Route exact path=”/about” render={({history: {location}}) => <About/>}/> <Route exact path=”/contact” render={({history: {location}}) => <Contact/>}/> <Route exact path=”/blog” render={({history: {location}}) => <Blog/>}/> </Switch> </div> <Footer /> </div> </Router> In the component for ..

Read more