Pass React props by routeOptions

I have two pages, such as the smart-select pages.

pageA link-to pageB, and pageB will pass a (object type) data back to pageA.

There are two way to do the back router

  • use Button/Link component with a back property
  • use f7router.back API

Both way can pass routeOptions to f7Router, which has a props property, but I can’t get the props value at PageA from it’s props.

What’s wrong with my process?

Thanks very much.

router props are not reactive. Once page loaded with props they won’t be modified. Use custom events to communicate between pages

Thank you, @nolimits4web

Hello, using framework7-react is there a way to call a parent method from a tab-route child component?

You should be able to do it by passing current component instance (this) as react context to child components using context api: https://reactjs.org/docs/context.html

Or using events https://framework7.io/docs/events.html

Thanks for the advise, I used the context api as mentioned here: https://www.freecodecamp.org/news/state-management-with-react-hooks/