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

application dies when re-rendering component #124

Open
Allegseu95 opened this issue Feb 19, 2024 · 0 comments
Open

application dies when re-rendering component #124

Allegseu95 opened this issue Feb 19, 2024 · 0 comments

Comments

@Allegseu95
Copy link

Describe the bug
When re-rendering the component in "react-native" version: "0.63.5", the app crashes. An error is identified that subscription.remove() is not a function because subscription is undefined.

To Reproduce
Steps to reproduce the behavior:

  1. You are in the view where your Swipe Button component is.
  2. you go to any other view
  3. You return to the first view where the Swipe Button component is
  4. and the app dies and shows the mentioned error

Expected behavior
I hope that when re-rendering the component the app does not die

Additional context
It is solved by adding optional chaining in subscription in the useEffect return function

image

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

No branches or pull requests

1 participant