-
Notifications
You must be signed in to change notification settings - Fork 581
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
chore: simplify routing logic [Part 1] #11178
Conversation
68301ce
to
2f34cca
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.
looking good! Thanks
Component, | ||
options = {}, | ||
Queries, | ||
}: { |
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.
Object props FTW
WorksForYou: reactModule({ | ||
Component: WorksForYouQueryRenderer, | ||
Queries: [WorksForYouScreenQuery], | ||
}), |
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 nicer!
Description
Now we are getting to the parts that matter. In this PR I am suggesting an incremental step to our Appregistry modules to help us move towards a more common definition for our modules.
I wanted to keep this PR's context small so I am making tiny changes here: (The PR looks big but it's actually the same change many times)
reactModule
function to accept a single argument (as a subject) instead of multiple argumentsSo instead of
reactModule(Component, ViewOptions, Queries)
, we will havereactModule({Component, options, Queries })
. This will help us avoid cases likereactModule(Component, {}, Quries)
This change will help us avoid maintaining 2 props and rely on the default option that comes from react-navigation.
Reasoning: https://github.com/artsy/eigen/blob/main/src/app/Navigation/Utils/isHeaderShown.tsx
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.