-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add plugin for React Native Navigation #1065
Conversation
92e859c
to
5084624
Compare
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.
Looks good. Nice and simple.
- Have you tested it manually on an example app?
- As a top-level plugin it will need types (there will be a similar example when I push my branch in a bit)
- A docs PR is needed
0778412
to
5d64d90
Compare
Yeah, I've tested v2, v3, v4, v5, v6 & v7
Added in 5d64d90
👍 |
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.
Looks good, manually verified working as expected on an example project.
5d64d90
to
3c2f314
Compare
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.
No comments from a test perspective.
I tripped up creating the test fixtures because I'd not passed It took a while to debug due to not having an error message, just a silent failure. Can we add some sort of message to that? |
We could but it definitely shouldn't be a silent failure; as soon as I think it's fine to add an error anyway though — what do you think @bengourley? |
It's not silent, but I guess crucially the error happens after the mistake was made. I think it would be a reasonable improvement to add a more friendly error in the constructor. Though this got me thinking, is there a use case for passing in |
This plugin cannot be listed in the main tsconfig because the globals exposed by React Native conflict with the DOM global. Instead we have to give it its own tsconfig, so that it can import the RN types but not the DOM typess
3c2f314
to
1a885ba
Compare
Goal
This PR adds a plugin for React Native Navigation. This plugin sets the context to the name of the currently rendered component and leaves a breadcrumb on each navigation change
Usage: