Closed kane81 closed 3 years ago
You need to use it in the component that wrap with <Route></Route>
Yes, @OysterD3 is right. Most meta info is route specific, that is why it should be involved only from a child component of any <Route>
.
But, I think more explicit error message should helps to use meta in the right way. I'll add it.
If you need none-route specific data like path, hash or query use router
subscription or route.location
methods.
Hi
according to the readme you can access meta data using the following code
I however cannot seem to get this code to work... I have added it to my App.svelte and I get an error
I have added the code into the repl example and get Cannot read property 'meta' of undefined
can you please add more guidance on how to init this property so we do not get this error. I have tried putting it in onMount() of App.svelte too and get the same error.
Thank you