import React, { useState } from 'react'; import { Affix, Button } from 'antd'; const App: React.FC = () => { const [top, setTop] = useState(10); const [bottom, setBottom] = useState(10); return ( <> setTop(top + 10)}> Affix top setBottom(bottom + 10)}> Affix bottom > ); }; export default App;