svelte-routing: was created with unknown prop 'location'
If use:
<Route exact path="about"><About /></Route>
All good.
If use:
<Route exact path="about" component={About} />
About.svelte:14 <About> was created with unknown prop ‘location’
About.svelte:14 <About> was created with unknown prop ‘exact’
Any ideal?
“svelte”: “^3.20.1” “svelte-routing”: “^1.4.2”
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Fix warnings about component created with unknown prop https://github.com/EmilTholin/svelte-routing/issues/122 — committed to statox/assisteer by deleted user 2 years ago
hey, @EmilTholin this package becoming popular. you should fix all of the bugs. I saw that the latest version is a year ago. please fix the bug
I get this warning if I do:
<Route path="post" component="{Post}" />
but not when I do<Route path="post"><Post /></Route>
In the About component add:
export let location;
I’m having the same exact issue.
PS use URLSearchParams instead of query-string
@EmilTholin I obviously have the same issue but was thinking that since the
location
prop is not always used by components would it not make sense to rather expose make it available via context/store (IIRC there isgetContext(LOCATION)
or some store).I’m not super familiar with
svelte-routing
internals but something like:EDIT: Interestingly I’ve just seen that svelte-spa-router does as I’m suggesting for both
$location
and$querystring
.