Skip to content

Instantly share code, notes, and snippets.

@snigo
Created October 5, 2023 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snigo/ad12ea0bc9969152ce383b6cdb150258 to your computer and use it in GitHub Desktop.
Save snigo/ad12ea0bc9969152ce383b6cdb150258 to your computer and use it in GitHub Desktop.
SOLID React article, code snippet 4: UserAvatar component - BAD
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