Skip to content

store.route doesn't contain the matched property #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danieldiekmeier opened this issue Jul 14, 2017 · 1 comment
Closed

store.route doesn't contain the matched property #63

danieldiekmeier opened this issue Jul 14, 2017 · 1 comment

Comments

@danieldiekmeier
Copy link

I noticed that the matched property doesn't exist on the cloned route that gets sent to the store.

I wanted to create a getter that basically merges all the meta fields, so I can access if from the templates:

export function meta (state) {
  return state.route.matched.reduce((prev, match) => {
    return Object.assign({}, prev, match.meta)
  }, {})
}

At the moment, it doesn't work. Could this be added, or are there reasons for the current behaviour?

A little bit related to #31.

@yyx990803
Copy link
Member

The problem is that matched may contain arbitrary values from the route configuration AND potentially component instances. These are not safely serializable when the devtool is taking snapshots and can lead to inconsistent behavior when you use time-travel debugging, persistence or snapshot exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants