File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 "dependencies" : {
4545 "@rc-component/motion" : " ^1.0.0" ,
4646 "@rc-component/portal" : " ^2.1.2" ,
47- "@rc-component/util" : " ^1.11.1 " ,
47+ "@rc-component/util" : " ^1.13.0 " ,
4848 "clsx" : " ^2.1.1"
4949 },
5050 "devDependencies" : {
Original file line number Diff line number Diff line change 1- import { useControlledState } from '@rc-component/util' ;
1+ import { isReactRenderable , useControlledState } from '@rc-component/util' ;
22import { clsx } from 'clsx' ;
33import * as React from 'react' ;
44import { useContext , useMemo , useState } from 'react' ;
@@ -152,7 +152,7 @@ const ImageInternal: CompoundedComponent<ImageProps> = props => {
152152 } ;
153153
154154 // ========================= ImageProps =========================
155- const isCustomPlaceholder = placeholder && placeholder !== true ;
155+ const isCustomPlaceholder = isReactRenderable ( placeholder ) && placeholder !== true ;
156156
157157 const src = previewSrc ?? imgSrc ;
158158 const [ getImgRef , srcAndOnload , status ] = useStatus ( {
@@ -273,7 +273,7 @@ const ImageInternal: CompoundedComponent<ImageProps> = props => {
273273 onError = { onError }
274274 />
275275
276- { status === 'loading' && (
276+ { status === 'loading' && isCustomPlaceholder && (
277277 < div aria-hidden = "true" className = { `${ prefixCls } -placeholder` } >
278278 { placeholder }
279279 </ div >
You can’t perform that action at this time.
0 commit comments