react-text-transition
react-text-transition copied to clipboard
Memory leak
I was using the component in a project, but it was causing a memory overflow.
A sample code with higth refresh frequency to check the leak: ` import React from 'react' import TextTransition, { presets } from "react-text-transition";
export default class Map extends React.Component { constructor(props) { super(props);
this.state = {
data: 9999
}
}
componentDidMount() {
this.interval = setInterval(() => this.setState({data: this.state.data + 1}), 500);
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() {
const { data } = this.state;
return (<TextTransition text={`Iteration number: ${data.toString()}`} springConfig={presets.wobbly}/>);
}
}`
Up this, facing the same issue.