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

Memory leak #48

Open
ffirenze opened this issue Jun 25, 2022 · 1 comment
Open

Memory leak #48

ffirenze opened this issue Jun 25, 2022 · 1 comment

Comments

@ffirenze
Copy link

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}/>);
}

}`

@thepirateboy
Copy link

Up this, facing the same issue.

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

2 participants