mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 20:49:14 +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;
|