C
C
ch-aqwer2018-01-31 13:34:48
JavaScript
ch-aqwer, 2018-01-31 13:34:48

Redirect to another site, react?

Good afternoon! Please tell me how to redirect to another site in this case?

ReactDom.render(
        role ?
          <Provider store={store}>
            <ConnectedRouter history={history}>
              <App />
            </ConnectedRouter>
          </Provider> : <NoRole url={newUrl}/>,
        document.getElementById('main'),
      );

Now I'm trying to pass the url in NoRole, I'm trying to write in componentDidMount in it, but the page just reloads. Please tell me how to make this redirect in this case? Thank you!
window.location = this.props.url;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question