Passing props between views


I setup two routers in my application:

  • </Home> → /
  • </Search> → /search

At </Home>, the application has a section for select a category and redirect the user to </Search> passing the search filter related to category in the url params.

I implemented this simply updating the current URL.

The change between views works fine, but looks like </InstantSearch> component is not detecting the new props received. I need to reload for see the expected result.

Probably I’m doing something bad. You can see it on live at

Any help is welcome, source code is available :smile:

Hi @josefrancisco.verdu,

Did you update the search state (via setState) when navigating to your new route?

The usual flow is => you navigate to the new route, you parse the url to reconstruct the search state and you do a setState with this new search state.

Because you’ll pass the search state to <InstantSearch/>, it will trigger a new rerender that should perform a new query.

I’m not updating setState, how to do that?

I suppose I need to do that at this point

oh, I found the way following your words!

Basically set the new state in the transition of the view :smile:

Preview: https://deploy-preview-254–

But now, I don’t know why, pagination based in URL is not working :thinking:


Can you indicate me the flow you’re doing to see that?

No problem @marielaure.thuret, I fixed that, finally.

It was a problem related with use mutliple createConnectors an manipulate hits :thumbsup: