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

Use implementation of useSharedValue in mock #1585

Merged

Conversation

Andreyco
Copy link
Contributor

@Andreyco Andreyco commented Jan 1, 2021

Previous implementation did lack "memoize" feature, essentially yielding incorrect return in certain cases.
I added mocks of useSharedValue's hook in order to "unmock" this hook and use its implementation in global mock.

PR contains hook test.

@Andreyco
Copy link
Contributor Author

Andreyco commented Jan 1, 2021

cc @jakub-gonet @mgambati since you created/reviews v2 mocks lately.

Copy link
Member

@jakub-gonet jakub-gonet left a comment

Choose a reason for hiding this comment

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

LGTM, left one comment.

src/reanimated2/__mocks__/MutableValue.js Outdated Show resolved Hide resolved
- previous implementation did lack "memoize" feature, essentially yielding incorrect return in certain cases.
- validate hook via test
@jakub-gonet jakub-gonet changed the title Update useSharedValue mock implementation. Use implementation in useSharedValue mock Jan 2, 2021
@jakub-gonet jakub-gonet self-assigned this Jan 2, 2021
@jakub-gonet jakub-gonet changed the title Use implementation in useSharedValue mock Use implementation of useSharedValue in mock Jan 4, 2021
@jakub-gonet jakub-gonet merged commit 09bfeab into software-mansion:master Jan 4, 2021
@Andreyco Andreyco deleted the update-useSharedValue-hook branch January 4, 2021 16:25
rpavlovs pushed a commit to rpavlovs/react-native-reanimated that referenced this pull request Jan 12, 2021
The previous implementation did lack "memoize" feature, essentially yielding an incorrect return in certain cases.
I added mocks of `useSharedValue`'s hook in order to "unmock" this hook and use its implementation in global mock.

PR contains hook test.

Co-authored-by: Andrej Badin <abadin@gohealth.com>
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.

None yet

2 participants