Archives : May-2018

One of my route component doesn’t work. I define my routing in App component as below: import React, { Component } from ‘react’; … … import Register from ‘./Register’; import { BrowserRouter, Route } from ‘react-router-dom’; class App extends Component { render() { return ( <Provider store={store}> <BrowserRouter> <div className=”content”> <Header/> … <Route path=’/signin’ component={ ..

Read more

I’m new to react and have this link in a component: <a href=”https://example.com/faq.html”> FAQ </a> I want to server faq.html outside react. The problem is that react treats the link as internal and gives 404. I have seen a similar question which suggest to use <Route …, but then I don’t know how to convert ..

Read more

Somewhere in component 1, I have this: if (redirectToReferrer) { return <Redirect to={{ pathname: “/test/new”, state: { event: “test” } }} />; } In my component 2, I have this: constructor(props){ super(props); console.log(this.props.location) //undefined } According to the docs, this should work. The state object can be accessed via this.props.location.state in the redirected-to component. This ..

Read more