-
Notifications
You must be signed in to change notification settings - Fork 26
Open
@ffirenze
Description
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}/>);
}
}`
Metadata
Metadata
Assignees
Labels
No labels