mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
23 lines
451 B
TypeScript
23 lines
451 B
TypeScript
import React from 'react';
|
|
import { Button, Spin } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [spinning, setSpinning] = React.useState<boolean>(false);
|
|
|
|
const showLoader = () => {
|
|
setSpinning(true);
|
|
setTimeout(() => {
|
|
setSpinning(false);
|
|
}, 3000);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Button onClick={showLoader}>Show fullscreen for 3s</Button>
|
|
<Spin spinning={spinning} fullscreen />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|