Skip to content

Commit

Permalink
优化props.src判断 || Optimize props.src judgment (#223)
Browse files Browse the repository at this point in the history
优化props.src判断
  • Loading branch information
eya46 authored Apr 27, 2024
1 parent fe6f5ea commit a99d776
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useState } from 'react';
import { Avatar, AvatarProps } from '../Avatar';
import { Image, imageUrlParser } from '../Image';
import { isValidStr } from '../utils';

export const AvatarWithPreview: React.FC<AvatarProps> = React.memo((props) => {
const [visible, setVisible] = useState(false);

const hasImage = typeof props.src === 'string';
const hasImage = isValidStr(props.src);

return (
<>
Expand Down

0 comments on commit a99d776

Please sign in to comment.