kdeloach/react-lineto

`deferUpdate` calls `forceUpdate` even after unmount

claudiopro opened this issue · 0 comments

If any of the components exported by react-lineto have a delay set, the component may schedule a call to forceUpdate after the component is unmounted:

// Forced update after delay (MS)
deferUpdate(delay) {
clearTimeout(this.t);
this.t = setTimeout(() => this.forceUpdate(), delay);
}

Fix is trivial and consists into clearing the timeout in componentWillUnmount(). I'll propose a fix shortly.