File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ type ImagePropTypes = {
6161 explicitWidth ?: boolean ;
6262 /** Triggered when the image finishes loading */
6363 onLoad ?( ) : void ;
64+ /** Whether the image should use a blurred image placeholder */
65+ usePlaceholder ?: boolean ;
6466} ;
6567
6668type State = {
@@ -116,6 +118,7 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
116118 explicitWidth,
117119 data,
118120 onLoad,
121+ usePlaceholder = true ,
119122 } ,
120123 ref
121124 ) => {
@@ -170,7 +173,7 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
170173 const transition =
171174 fadeInDuration > 0 ? `opacity ${ fadeInDuration } ms` : undefined ;
172175
173- const placeholder = (
176+ const placeholder = usePlaceholder ? (
174177 < div
175178 style = { {
176179 backgroundImage : data . base64 ? `url(${ data . base64 } )` : undefined ,
@@ -181,7 +184,7 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
181184 ...absolutePositioning ,
182185 } }
183186 />
184- ) ;
187+ ) : null ;
185188
186189 const { width, aspectRatio } = data ;
187190 const height = data . height || width / aspectRatio ;
You can’t perform that action at this time.
0 commit comments