glennreyes / glennreyes/react-countup

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

Open
#432 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
138
PR merge metrics
No merged PRs in 30d

Description

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
```javascript
const ChildComponent = ({ value }) => {
const { countUp, update } = useCountUp({ start: 0, end: value, duration: 2 });

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

return (

{countUp}

);
};

export default ChildComponent
```
When I close a page that contains the 'ChildComponent' component, some error occur that cause memory leaks like this
![image](https://user-images.githubusercontent.com/40848316/101129904-7217cf00-363d-11eb-9468-d5d1831f9298.png)
May I ask the author, how should I solve this problem.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.