Skip to content

Make "component" a required property for a route #1892

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
danidee10 opened this issue Nov 17, 2017 · 1 comment
Closed

Make "component" a required property for a route #1892

danidee10 opened this issue Nov 17, 2017 · 1 comment

Comments

@danidee10
Copy link

What problem does this feature solve?

It improves the developer experience. Currently if a developer omits or misspells the component key of a route object ({ path: '/foo', Component: FooComponent }) Notice the Capital letter in Component.

No warning is shown (A blank page would be rendered since the path has no Component defined on it), There's already a warning if a developer tries to use a String as a Component. I believe this would also be useful as there's no point having a route that doesn't point to any Component.

What does the proposed API look like?

There's no change to the API.

posva added a commit that referenced this issue Nov 17, 2017
Closes #1892
Throws for missing component, components or redirect and also when components is empty
@posva
Copy link
Member

posva commented Nov 17, 2017

Unfortuntaely, this is actually not possible because you can redirect in the beforeRouteEnter to somewhere else, therefore, component (or components or redirect) is not required 🙁

@posva posva closed this as completed Nov 17, 2017
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