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

ReanimatedSwipeable generating warnings #3170

Open
jbrodriguez opened this issue Oct 19, 2024 · 14 comments
Open

ReanimatedSwipeable generating warnings #3170

jbrodriguez opened this issue Oct 19, 2024 · 14 comments
Labels
Missing repro Platform: iOS This issue is specific to iOS

Comments

@jbrodriguez
Copy link

Description

trying the example for ReanimatedSwipeable generates warnings on the logs

in my case, i just used RightAction, however those SharedValues seem to be causing the warnings

Screenshot 2024-10-19 at 17 20 17

Steps to reproduce

run the example from the repo

Snack or a link to a repository

https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/release_tests/swipeableReanimation/index.tsx

Gesture Handler version

2.22.0

React Native version

0.76.0-rc.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

None

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Missing repro labels Oct 19, 2024
@jbrodriguez
Copy link
Author

for the time being, im just setting strict to false 🤷‍♂️

@latekvo
Copy link
Contributor

latekvo commented Oct 21, 2024

Hi @jbrodriguez, thank you for reporting this issue.

Would it be possible for you to share a branch or a repository on which you reproduced this issue?

I could not find this issue occurring on:

  • rn 0.74.1 + rngh 2.20.0 + rea 3.10.0 + oldArch.
  • rn 0.74.1 + rngh 2.20.0 + rea 3.16.0 + oldArch.
  • rn 0.74.1 + rngh 2.20.0 + rea 3.16.0 + newArch.

Unfortunately I couldn't test on rn 0.76.0-rc.6, there are multiple breaking changes when upgrading from rn 0.74.1 to rn 0.76.0-rc.6, both on android and iOS.

Tested everything in StrictMode.

I also couldn't manually find any instance of .value anywhere in the render body of either the ReanimatedSwipeable component, or the example you linked.

Are you certain this is an issue with our example or component?

@jbrodriguez
Copy link
Author

sure, ill provide a repo later today

@BrightFoxApps
Copy link

BrightFoxApps commented Oct 29, 2024

I have this same issue (same warnings) with ReanimatedSwipeable. I have created a minimal repro of this issue that has the component with no props and still gives the warning. The warning happens with version 3.16.1 of rnr but not 3.15.4, and happens irrespective of versions of rngh and rn. So it seems it's the new version of react-native-reanimated causing the warning to happen, but due to something in ReanimatedSwipeable?

This is a newly initiated project with rngh and rnr installed according to instructions.
Clicking the counter causes the screen to re-render and causes the warning to happen.
https://github.com/BrightFoxApps/SwipeableTest

rn 0.75.4 + rngh 2.20.0 + rnr 3.15.4 + old arch = no warnings
rn 0.76.1 + rngh 2.20.2 + rnr 3.15.4 + new arch = no warnings
rn 0.75.4 + rngh 2.20.0 + rnr 3.16.1 + old arch = warnings
rn 0.76.1 + rngh 2.20.2 + rnr 3.16.1 + new arch = warnings

(NOBRIDGE) WARN  [Reanimated] Reading from `value` during component render. Please ensure that you do not access the `value` property or use `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.

edit: Some more testing:
The warnings happen with ReanimatedSwipeable from react-native-gesture-handler/ReanimatedSwipeable, but not with Swipeable from react-native-gesture-handler, which makes sense given the warnings come from react-native-reanimated

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided and removed Missing repro labels Oct 29, 2024
@danieltott
Copy link

@latekvo The version of src/components/ReanimatedSwipeable.tsx in main is reading from leftWidth.value and rightWidth.value in the useCallback dependency array:

[
rowState,
animationOptionsProp,
appliedTranslation,
showLeftProgress,
leftWidth.value,
showRightProgress,
rightWidth.value,
dispatchImmediateEvents,
dispatchEndEvents,
]

@github-actions github-actions bot added Missing repro and removed Repro provided A reproduction with a snack or repo is provided labels Oct 31, 2024
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@danieltott
Copy link

(The version that is in npm on 2.20.2 has this code at line 415)

@latekvo
Copy link
Contributor

latekvo commented Oct 31, 2024

Hey @danieltott, thank you for pointing that out.

I'm aware of the issue and what causes it and I'm currently working on it.
Removed majority of the offending .value dependencies in this unfinished PR.
I'll come back to this issue shortly.

Also, thank you a lot @BrightFoxApps for finding the exact versions on which the issue occurs and providing a repro,
it'll really help with testing.

@duanykruger
Copy link

I encountered the same issue using Reanimated Swipeable, even with the example provided in the documentation.

Here are the dependencies I'm using:

"@shopify/flash-list": "^1.7.1",
"react": "18.3.1",
"react-native": "0.76.1",
"react-native-gesture-handler": "^2.20.2",
"react-native-reanimated": "^3.16.1"

The problem occurred with the GitHub example; I only added an input field to save the item. Starting from the second item, these warnings flood the screen with each new item added.

@latekvo
Copy link
Contributor

latekvo commented Nov 7, 2024

I believe this PR should've fixed all of these warnings, please let me know if you're still encountering them.
Feel free to close this issue if the problem is resolved.

@usmansbk
Copy link

@latekvo has the PR been published? Otherwise, I am still seeing the warnings.

@shuo-hiwintech
Copy link

+1

@latekvo
Copy link
Contributor

latekvo commented Nov 12, 2024

has the PR been published? Otherwise, I am still seeing the warnings.

The fix isn't published yet, it'll be included in the upcoming release.

@duanykruger
Copy link

Thanks a lot for the fix, @latekvo! Do you have any estimate on when the next version might be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

7 participants