sticky react-sticky 如何简单使用

git原文:https://github.com/captivationsoftware/react-sticky

NPM:

# npm install react-sticky
import React from 'react';
import { StickyContainer, Sticky } from 'react-sticky';

            
              {({
                style,
                isSticky,
                wasSticky,
                distanceFromTop,
                distanceFromBottom,
                calculatedHeight
              }) => (
                
设备状态:: '离线中'
)}
{/* Sticky 为悬浮框 */}
{/* content body */}

注:StickyContainer 需要包裹所有内容

你可能感兴趣的:(react,sticky,悬浮)