Async link with loading based on antd.
npm install -S @jswork/react-ant-async-buttonimport React from 'react';
import ReactAntAsyncButton from '@jswork/react-ant-async-button';
import styled from 'styled-components';
const Container = styled.div`
width: 80%;
margin: 30px auto 0;
`;
export default () => {
return (
<Container>
<ReactAntAsyncButton
minGap={2000}
callback={() => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(null);
}, 100);
});
}}>
Download
</ReactAntAsyncButton>
</Container>
);
};Code released under the MIT license.