我无法在sticky document中找到类似isActive
的道具,可以像react-sticky一样轻松禁用粘性。是否有可能在Semantic-UI-React粘性中做到这一点?
我已尝试在context
中将Sticky
道具设为null,但在滚动时它仍然很粘。
粘性代码:
export default class StickyAdjacentContextExample extends Component {
state = {}
handleContextRef = contextRef => this.setState({ contextRef })
render() {
const { contextRef } = this.state
return (
<div ref={this.handleContextRef}>
<Sticky context={contextRef}>
<Header as='h3'>Stuck Content</Header>
<Image src='/assets/images/wireframe/image.png' />
</Sticky>
</div>
)
}
}