I have a web page with a search panel. Search panel has several input fields: id, size, ...
What I want is when user set search values (for example: id=123 and size=45) and press a search button:
And on the other hand if the user changes URL to http://mydomain/home?id=111&size=22 then:
How to reach with goal? What router should I use (react-router, redux-router, react-router-redux ot other)?
I would suggest just using React Router directly and not keeping searchState
in Redux. React Router will inject URL parameters into your components, and you can use them in mapStateToProps(state, ownProps)
to calculate the final props.
If you really want to see route changes as actions, you can use react-router-redux for two-way syncing, but it won’t give you the params in the state—just the current location. The only use case for it if you want to record and replay actions, and have the URL bar update as you replay them.
It is by no means required—in most cases, just using React Router directly is enough.