KyleAMathews / react-headroom

Hide your header until you need it
https://kyleamathews.github.io/react-headroom
MIT License
1.84k stars 149 forks source link

Parent prop and ComponentWIllUnmount #169

Closed krllmdntsv closed 3 years ago

krllmdntsv commented 5 years ago

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!

aprofromindia commented 4 years ago

PR here

janczizikow commented 3 years ago

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