AlexeiBerkov AlexeiBerkov - 4 months ago 28
React JSX Question

React-Router (2.6.0) redirection with params outside component

Dear stackoverflowers.

I have updated our project`s dependencies recently. One main updated is migration to the latest react-router. The question is:

How to redirect to named route outside the component with params ? Before we did it like

hashHistory.transitionTo(routerName, {params});

Answer

Now you will have do something like this

history.push({
  pathname: '/about',
  search: '?the=search',
  state: { some: 'state' }
})

Here is the link for API documentation n