Skip to content

Commit

Permalink
fix(react): adjust PropTypes for React Component container (#107)
Browse files Browse the repository at this point in the history
Augments the existing PropType for the `container` prop of Component to allow for React elements and element types to be passed. The latter allows React Native to better be supported.
  • Loading branch information
dpolivy committed Jun 23, 2021
1 parent b7e55a5 commit 93d8027
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/bbob-react/src/Component.js
Expand Up @@ -18,7 +18,11 @@ const Component = ({

if (process.env.NODE_ENV !== 'production') {
Component.propTypes = {
container: PropTypes.node,
container: PropTypes.oneOfType([
PropTypes.node,
PropTypes.element,
PropTypes.elementType,
]),
children: PropTypes.node.isRequired,
plugins: PropTypes.arrayOf(PropTypes.func),
componentProps: PropTypes.shape({
Expand Down

0 comments on commit 93d8027

Please sign in to comment.