import React, { useRef, useState } from 'react'; import { Button, Tour } from 'antd'; import type { TourProps } from 'antd'; const App: React.FC = () => { const ref = useRef(null); const [open, setOpen] = useState(false); const steps: TourProps['steps'] = [ { title: 'Center', description: 'Displayed in the center of screen.', target: null, }, { title: 'Right', description: 'On the right of target.', placement: 'right', target: () => ref.current, }, { title: 'Top', description: 'On the top of target.', placement: 'top', target: () => ref.current, }, ]; return ( <> setOpen(false)} steps={steps} /> ); }; export default App;