Skip to content
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

Reduce warnings... #40

Open
frederikhors opened this issue Apr 11, 2020 · 6 comments
Open

Reduce warnings... #40

frederikhors opened this issue Apr 11, 2020 · 6 comments

Comments

@frederikhors
Copy link
Contributor

In order to reduce <PageX> was created with unknown prop 'router' warning can we use something like svelte-spa-router?

https://github.com/ItalyPaleAle/svelte-spa-router/blob/master/Router.svelte#L207-L211.

What do you think about?

@frederikhors
Copy link
Contributor Author

Thinking about it, we can't.

Because props are different.

@frederikhors
Copy link
Contributor Author

Right?

@pateketrueke
Copy link
Owner

If we just remove such prop? I mean, we can live using the $router store only. 🤔

Comparing the needed boilerplate:

import { router } from 'yrv';
console.log($router.path);

vs

export let router = null;
console.log(router.path);

I'm not aware of the implications, but the change is fairly simple.

@frederikhors
Copy link
Contributor Author

Oh dear. This is amazing!

@frederikhors
Copy link
Contributor Author

So we are just using Svelte stores, right?

@pateketrueke
Copy link
Owner

pateketrueke commented Apr 11, 2020

So we are just using Svelte stores, right?

Yes! Actually there is a subtle difference, the let router has three additional props, but they are completely optional so I think it's fine to omit them completely.

If we change that, we need to remove the let:router support too from slots to keep things consistent I guess.

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