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: way of reading the value from animated shared values in the components #2738

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

khushal87
Copy link
Member

🎯 Goal

The warning on RN 0.74 with the React native reanimated throws:

 WARN  [Reanimated] Reading from `value` during component render. Please ensure that you do not access the `value` property or use the `get` method of a shared value while React is rendering a component.

If you don't want to see this message, you can disable the `strict` mode. Refer to:
https://docs.swmansion.com/react-native-reanimated/docs/debugging/logger-configuration for more details.

This has been fixed in multiple places, including the ImageGallery, AnimatedImageGallery and AnimatedGalleryVideo components.

For the useImageGalleryGestures, the index is not at all an animated value but can be managed using a local state, so that is what I have done in the PR, and the change is for the better.

There was a bug with the background color in the image gallery component that I might have introduced in the past while testing an issue for a customer so that has been fixed as well on v6.

@Stream-SDK-Bot
Copy link
Contributor

Stream-SDK-Bot commented Oct 29, 2024

SDK Size

title develop branch diff status
js_bundle_size 446.7021484375 KB 445 KB -1926 B 🚀

@khushal87 khushal87 merged commit 308806e into v6.0.0 Oct 29, 2024
7 checks passed
@khushal87 khushal87 deleted the fix-reanimated-warnings branch October 29, 2024 10:39
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.

4 participants