Skip to content

Commit 2c3c92e

Browse files
committed
chore: set default value for fadeInDuration in arg
1 parent cd37d28 commit 2c3c92e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Image/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const imageShowStrategy = ({ lazyLoad, loaded }: State) => {
101101

102102
export const Image: React.FC<ImagePropTypes> = function ({
103103
className,
104-
fadeInDuration,
104+
fadeInDuration = 500,
105105
intersectionTreshold,
106106
intersectionThreshold,
107107
intersectionMargin,
@@ -150,8 +150,8 @@ export const Image: React.FC<ImagePropTypes> = function ({
150150
);
151151

152152
const transition =
153-
typeof fadeInDuration === "undefined" || fadeInDuration > 0
154-
? `opacity ${fadeInDuration || 500}ms ${fadeInDuration || 500}ms`
153+
fadeInDuration > 0
154+
? `opacity ${fadeInDuration}ms ${fadeInDuration}ms`
155155
: undefined;
156156

157157
const placeholder = (

0 commit comments

Comments
 (0)