KyleAMathews/react-headroom

Parent prop and ComponentWIllUnmount

krllmdntsv opened this issue · 2 comments

Hello! Thank you for your job, it is very useful for me. But i have a problem. When i pass parent prop to Headroom like this:
<Headroom parent={ () => wrapper.current } /> it's work fine.
But when component used Headroom is unmount then i have a warning
Cannot read property 'removeEventListener' of null and it crush in this line
this.props.parent().removeEventListener('scroll', this.handleScroll);
Can you fix it? Thank you!

should be fixed with #184 (released in v3.0.1) I merged the newer PR as the #175 had some conflicts.