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

when close the page that contains the 'CountUp' component cause memory leaks #432

Open
Ice-Panda opened this issue Dec 4, 2020 · 6 comments

Comments

@Ice-Panda
Copy link

Firstly, thanks to the author for providing such an amazing component, when I use the component according to the API interface, I had some problems.
Here's the code

const ChildComponent = ({ value }) => {
    const { countUp, update } = useCountUp({ start: 0, end: value, duration: 2 });

    React.useEffect(() => {
        update(value);
    }, [update, value]);

    return (
        <div>{countUp}</div>
    );
};

export default ChildComponent

When I close a page that contains the 'ChildComponent' component, some error occur that cause memory leaks like this
image
May I ask the author, how should I solve this problem.

@mmarkelov
Copy link
Collaborator

mmarkelov commented Dec 4, 2020

@Ice-Panda it will be nice if you could make small repro. Cause it's quite difficult to investigate

@vertic4l
Copy link

This memory leak issue is also very annoying in tests

@mmarkelov
Copy link
Collaborator

@vertic4l could you provide a representation of this bug? I tried to reproduce it, but I didn’t face with this issue

@vertic4l
Copy link

Bildschirmfoto 2021-04-23 um 11 48 58

@vertic4l
Copy link

Bildschirmfoto 2021-04-23 um 11 53 04

@vertic4l
Copy link

Bildschirmfoto 2021-04-23 um 11 55 58

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

3 participants