From 93d802773cbe733ccf4b0124257c6fc6707c873b Mon Sep 17 00:00:00 2001 From: Dan Polivy Date: Wed, 23 Jun 2021 14:27:08 -0700 Subject: [PATCH] fix(react): adjust PropTypes for React Component `container` (#107) 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. --- packages/bbob-react/src/Component.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bbob-react/src/Component.js b/packages/bbob-react/src/Component.js index 747b3ad..abc953c 100644 --- a/packages/bbob-react/src/Component.js +++ b/packages/bbob-react/src/Component.js @@ -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({