Browse Source

fix: Fixed an error when the loading property of the Button component… (#36288)

* fix: Fixed an error when the loading property of the Button component was passed into null

* Update components/button/button.tsx

Obviously, this suggestion is more concise , thanks a lot

Co-authored-by: afc163 <afc163@gmail.com>

* Update components/button/button.tsx

* Update components/button/button.tsx

Co-authored-by: kejianfeng <kejianfeng@cvte.com>
Co-authored-by: afc163 <afc163@gmail.com>
pull/36325/head
Jamki 2 years ago
committed by GitHub
parent
commit
5f933ebd2b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/button/button.tsx

2
components/button/button.tsx

@ -190,7 +190,7 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
// =============== Update Loading ===============
const loadingOrDelay: Loading =
typeof loading === 'object' && loading.delay ? loading.delay || true : !!loading;
typeof loading === 'boolean' ? loading : (loading?.delay || true);
React.useEffect(() => {
let delayTimer: number | null = null;

Loading…
Cancel
Save