We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6ef290a + 7ce1d3c commit 6260a3cCopy full SHA for 6260a3c
index.js
@@ -50,7 +50,7 @@ class UserAvatar extends React.PureComponent {
50
borderRadius,
51
style,
52
} = this.props;
53
- if (!name) throw new Error('Avatar requires a name');
+ if (!name && !src) throw new Error('Avatar requires a name or source');
54
if (typeof size !== 'number') size = parseInt(size);
55
let abbr = initials(name);
56
if (name.startsWith('+')) {
0 commit comments