diff --git a/lib/create-icon-set.js b/lib/create-icon-set.js index 3dc7969..818307c 100644 --- a/lib/create-icon-set.js +++ b/lib/create-icon-set.js @@ -33,7 +33,7 @@ export default function createIconSet(glyphMap, fontFamily, fontFile) { class Icon extends Component { static propTypes = { - name: IconNamePropType.isRequired, + name: IconNamePropType, size: PropTypes.number, color: PropTypes.string, children: PropTypes.node, @@ -59,7 +59,7 @@ export default function createIconSet(glyphMap, fontFamily, fontFile) { render() { const { name, size, color, style, ...props } = this.props; - let glyph = glyphMap[name] || '?'; + let glyph = name ? glyphMap[name] || '?' : ''; if (typeof glyph === 'number') { glyph = String.fromCharCode(glyph); }