@@ -6,7 +6,6 @@ import type {ImgHTMLAttributes, SyntheticEvent} from "react";
6
6
7
7
import { useRef , useState , useEffect , MutableRefObject } from "react" ;
8
8
import { useIsHydrated } from "@nextui-org/react-utils" ;
9
- import { useSafeLayoutEffect } from "@nextui-org/use-safe-layout-effect" ;
10
9
11
10
type NativeImageProps = ImgHTMLAttributes < HTMLImageElement > ;
12
11
@@ -66,7 +65,7 @@ type ImageEvent = SyntheticEvent<HTMLImageElement, Event>;
66
65
*/
67
66
68
67
export function useImage ( props : UseImageProps = { } ) {
69
- const { loading , src , srcSet , onLoad, onError, crossOrigin , sizes , ignoreFallback} = props ;
68
+ const { onLoad, onError, ignoreFallback} = props ;
70
69
71
70
const isHydrated = useIsHydrated ( ) ;
72
71
@@ -76,18 +75,6 @@ export function useImage(props: UseImageProps = {}) {
76
75
isHydrated ? setImageAndGetInitialStatus ( props , imageRef ) : "pending" ,
77
76
) ;
78
77
79
- useSafeLayoutEffect ( ( ) => {
80
- if ( ! isHydrated ) {
81
- return ;
82
- }
83
-
84
- setStatus ( setImageAndGetInitialStatus ( props , imageRef ) ) ;
85
-
86
- return ( ) => {
87
- flush ( ) ;
88
- } ;
89
- } , [ src , crossOrigin , srcSet , sizes , loading ] ) ;
90
-
91
78
useEffect ( ( ) => {
92
79
if ( ! imageRef . current ) return ;
93
80
imageRef . current . onload = ( event ) => {
0 commit comments