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

Fix a bug where full state was being passed to a withOnyx selector #208

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

tgolen
Copy link
Collaborator

@tgolen tgolen commented Oct 28, 2022

Details

There was this code that was passing the entire state object to the selector. That's wrong. Instead, it should only be passing the piece of state that the withOnyx mapping is working with.

cc @marcaaron

Related Issues

Fixes an issue I found while testing Expensify/App#12083

Automated Tests

Covered by automated tests

@tgolen tgolen self-assigned this Oct 28, 2022
@tgolen tgolen requested a review from a team as a code owner October 28, 2022 17:23
@melvin-bot melvin-bot bot requested review from joelbettner and removed request for a team October 28, 2022 17:24
@@ -16,6 +16,23 @@ Onyx.init({
registerStorageEventListener: () => {},
});

class ErrorBoundary extends React.Component {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcaaron I ran into more cases where if there is a syntax error inside the selector function, then Jest isn't able to catch and report it.

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:oh-nothing: good thing we're not using any selectors yet 😄

Change LGTM!

@tgolen
Copy link
Collaborator Author

tgolen commented Oct 31, 2022

@joelbettner bump for review please

Copy link
Contributor

@joelbettner joelbettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM 👍

@joelbettner joelbettner merged commit 3f6cea0 into main Oct 31, 2022
@tgolen tgolen deleted the tgolen-fix-subsetdata branch October 31, 2022 17:19
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

Successfully merging this pull request may close these issues.

3 participants