captivationsoftware/react-sticky

Usage of isActive with version 6.0.0

Closed this issue · 2 comments

Is there a way to use version 6.0.0 and continue to decide to activate/deactivate the stickiness of a element?

Of course - just don't use the style property when you don't want your <Sticky /> to be active:

{ ({ style }) => <div style={ this.state.isActive ? style : {} } /> }

Yes ! And don't forget to disableCompensation

<Sticky disableCompensation={true}>

it will remove this unwanted div :

<div style="padding-bottom: 1006px;"></div>