react-countup icon indicating copy to clipboard operation
react-countup copied to clipboard

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

Open Ice-Panda opened this issue 5 years ago • 6 comments

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.

Ice-Panda avatar Dec 04 '20 06:12 Ice-Panda

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

mmarkelov avatar Dec 04 '20 08:12 mmarkelov

This memory leak issue is also very annoying in tests

vertic4l avatar Apr 22 '21 14:04 vertic4l

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

mmarkelov avatar Apr 22 '21 17:04 mmarkelov

Bildschirmfoto 2021-04-23 um 11 48 58

vertic4l avatar Apr 23 '21 09:04 vertic4l

Bildschirmfoto 2021-04-23 um 11 53 04

vertic4l avatar Apr 23 '21 09:04 vertic4l

Bildschirmfoto 2021-04-23 um 11 55 58

vertic4l avatar Apr 23 '21 09:04 vertic4l