kriasoft / universal-router

A simple middleware-style router for isomorphic JavaScript web apps
https://www.kriasoft.com/universal-router/
MIT License
1.7k stars 104 forks source link

Make params available to child routes #79

Closed gmuresan closed 7 years ago

gmuresan commented 7 years ago

I have a route that has an :id parameter and also contains a bunch of children. The children of this route need access to the :id parameter but right now the only way to get it is to parse context.baseUrl.

There should be a way to access the params from the parent route in each of the children.

frenzzy commented 7 years ago

This feature was implemented in #57 and available since v2.0.0. Playground: https://jsfiddle.net/frenzzy/gfLrh6s8/ Please let us know if you are having trouble with it.

gmuresan commented 7 years ago

Thank you. My parent route had a parameter that had the same name as the child parameter, so it was being overwritten by the child.