Skip to content

Commit

Permalink
fix(factories): explicitly handle each value type
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Sep 23, 2016
1 parent 68921fe commit 112d38c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/factories.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export function createShorthand(Component, mapValueToProps, val, extraProps = {}
}

// Map values to props and create a ReactElement
if (!_.isNil(val)) {
if (_.isString(val) || _.isNumber(val)) {
return <Component {...mergePropsAndClassName(mapValueToProps(val), extraProps)} />
}

// React requires ReactElements or null be returned
// Otherwise null
return null
}

Expand Down

0 comments on commit 112d38c

Please sign in to comment.