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

Multiple route paths with same params #121

Closed juusaw closed 6 years ago

juusaw commented 6 years ago

It seems that using multiple paths with same route parameters within a route overwrites the parameters for some routes. This can be reproduced by defining a route like this:

const route = {
  path: ['/one/:parameter', '/two/:parameter'],
  action: ({ params }) => { console.log(params) }
}

When navigating to the former route, params seems to contain the key parameter but the value is undefined. The latter route works as expected, yielding a value for the parameter.

I tested the case with version 3.2.0 and 4.0.0.

frenzzy commented 6 years ago

For review: #122