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

Animation stoping when navigate to another screen #23

Open
matheuscasavechia opened this issue Aug 9, 2022 · 6 comments
Open

Animation stoping when navigate to another screen #23

matheuscasavechia opened this issue Aug 9, 2022 · 6 comments

Comments

@matheuscasavechia
Copy link

Hi everyone,
I'm having a problem with te animation... I use the same component exporting it to use in another screen and the component is using AutoScroll, but when i navigate to another screen, and this has the component i'm exporting, the animation stop...
Can you guys help me ?

@bhyoo99
Copy link
Contributor

bhyoo99 commented Aug 10, 2022

�Can you provide me with a more accurate environment or code to check the issue?

@matheuscasavechia
Copy link
Author

�Can you provide me with a more accurate environment or code to check the issue?

Like, i have a component that is using the tag AutoScroll, and this component i use an many screen in my app.
When i'm in the home screen of my app (in this screen i declare the component), and navigate to another screen, screen that have the component, the AutoScroll stop the scroll, to get the scroll work again i need to retry the same flow, many times until they appear start working again... but when i continue testing the scroll stop again and i need to do the flow again to get the component working again.

@kmlrmdhn
Copy link

@matheuscasavechia did you find solution about this error?

@julien-ctx
Copy link
Contributor

I had the same problem and I fixed it by deleting the following code snippet from index.tsx:

React.useEffect(() => {
    return () => {
      contentRef.current = null;
    };
  });

Depending on how you setup your app, it appears that contentRef.current can be null even though you have data in your children components. React is apparently already setting contentRef.current to null when the component is unmounted.

@kmlrmdhn
Copy link

@julien-ctx it works, thanks man.

@minhtc
Copy link
Collaborator

minhtc commented Sep 13, 2023

I had the same problem and I fixed it by deleting the following code snippet from index.tsx:

React.useEffect(() => {
    return () => {
      contentRef.current = null;
    };
  });

Depending on how you setup your app, it appears that contentRef.current can be null even though you have data in your children components. React is apparently already setting contentRef.current to null when the component is unmounted.

Thank you. Can you help me by make a pull request?

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

5 participants