Created
October 5, 2023 21:52
-
-
Save snigo/ad12ea0bc9969152ce383b6cdb150258 to your computer and use it in GitHub Desktop.
SOLID React article, code snippet 4: UserAvatar component - BAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Image, { type ImageProps } from 'next/image'; | |
import { type User } from './types'; | |
interface UserAvatarProps extends ImageProps { | |
user: User; | |
} | |
export const UserAvatar: React.FunctionComponent<UserAvatarProps> = ({ | |
user, | |
...props | |
}) => { | |
return <Image {...props} src={user.imageUrl} alt={user.name} />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment