captivationsoftware/react-sticky

[Feature request] isActive prop lost in upgrade to v6

Closed this issue · 2 comments

Feature request

No easy way to turn sticky on/off. Prior to v6 there was an isActive (boolean) prop on Sticky that could be used for stopping the sticky behavior in certain instances, i.e. mobile.

See #56 & #60

vcarl commented

Sorry I didn't respond to this sooner. You should be able to conditionally apply style to replicate this.

<StickyContainer>
  <Sticky>
    {({ style }) => <h1 style={isActive ? style : null}>Sticky element</h1>}
  </Sticky>
</StickyContainer>

Since it's a relatively simple change, I'm not sure it's worth an API change to bring it back. If you feel differently I'd be happy to discuss it further!

Hello guys,

Do not understand why the issue is closed as the problem always persists.