-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Move props
option to second arg of createRoute
utility
#421
Conversation
✅ Deploy Preview for kitbag-router ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great, I got it building (committed) and fixed all the tests that relied on props (also committed)
6ad8fc3
to
8b20533
Compare
…es in the prop store
props
option to second arg of createRoute
utilityprops
option to second arg of createRoute
utility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 IT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so much simpler! 😍
Description
By moving the
props
option ofcreateRoute
to the second argument we can get much better typescript support and typescript errors. The utility will now correctly error when props are missing entirely if it detects the component has props that are required. And if the return type from the props function doesn't match the expected type for a component it gives much better errors.Routes with named views will also expect an object by the same keys