Skip to content

Conversation

@jrobinson01
Copy link
Contributor

adds an optional metaData object to the route config. This can be used to store additional information about a route. To access the metaData in routeEnter (or anywhere you have a reference to the router) use something like:

const destinationNode = this.router.routeTree.getNodeByKey(routeId);
this.heading = destinationNode.getValue().metaData.title || '';

Copy link
Contributor

@chrisgubbels chrisgubbels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, would you mind adding it to the readme files documentation?

@jrobinson01
Copy link
Contributor Author

added to the readme and demo app: a238def

@jrobinson01 jrobinson01 merged commit 4add752 into master Sep 26, 2025
4 checks passed
@jrobinson01 jrobinson01 deleted the route-meta-data branch September 26, 2025 20:26
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

Successfully merging this pull request may close these issues.

3 participants