Usage of isActive with version 6.0.0
Closed this issue · 2 comments
aribronstein commented
Is there a way to use version 6.0.0 and continue to decide to activate/deactivate the stickiness of a element?
dbarbalato commented
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 : {} } /> }
florianboudot commented
Yes ! And don't forget to disableCompensation
<Sticky disableCompensation={true}>
it will remove this unwanted div :
<div style="padding-bottom: 1006px;"></div>