Skip to content

Commit

Permalink
[@mantine/core] Image: Fix race condition between hydration and image…
Browse files Browse the repository at this point in the history
… load event (#629)
  • Loading branch information
rtivital committed Sep 29, 2022
1 parent c518490 commit 2acaf0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantine-core/src/Image/Image.tsx
Expand Up @@ -78,7 +78,7 @@ export const Image = forwardRef<HTMLDivElement, ImageProps>((props: ImageProps,
...others
} = useComponentDefaultProps('Image', defaultProps, props);
const { classes, cx } = useStyles({ radius }, { classNames, styles, unstyled, name: 'Image' });
const [loaded, setLoaded] = useState(false);
const [loaded, setLoaded] = useState(!!src);
const [error, setError] = useState(!src);
const isPlaceholder = withPlaceholder && (!loaded || error);

Expand Down

0 comments on commit 2acaf0a

Please sign in to comment.