import React, { useState } from 'react';
import { Affix, Button } from '@btri-ui/base';
import './index.less';
export default () => {
  const [container, setContainer] = useState<HTMLDivElement | null>(null);
  return (
    <div ref={setContainer} className="containerAffix">
      <div>
        <Affix target={() => container}>
          <Button type="primary">Fixed at the top of container</Button>
        </Affix>
      </div>
    </div>
  );
};
