Skip to content

Commit

Permalink
fix(customPropTypes): allow to pass an object to "as" (#3139)
Browse files Browse the repository at this point in the history
* Allows having JSX elements as an "as" property

See #3138 for the problem described. 
Solves problem when custom links are used

* update order
  • Loading branch information
tomitrescak authored and layershifter committed Sep 10, 2018
1 parent 4d0688a commit 9d36af3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/customPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const typeOf = (...args) => Object.prototype.toString.call(...args)
* Ensure a component can render as a give prop value.
*/
export const as = (...args) =>
PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.symbol])(...args)
PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string, PropTypes.symbol])(...args)

/**
* Ensure a prop is a valid DOM node.
Expand Down

0 comments on commit 9d36af3

Please sign in to comment.