diff --git a/packages/bbob-react/src/Component.js b/packages/bbob-react/src/Component.js index 74ca6b2..a49f35f 100644 --- a/packages/bbob-react/src/Component.js +++ b/packages/bbob-react/src/Component.js @@ -5,14 +5,26 @@ import { render } from './render'; const content = (children, plugins, options) => React.Children.map(children, child => (typeof child === 'string' ? render(child, plugins, options) : child)); -const Component = props => - React.createElement(props.container, {}, content(props.children, props.plugins, props.options)); +const Component = ({ + container, + componentProps, + children, + plugins, + options, +}) => React.createElement( + container, + componentProps, + content(children, plugins, options), +); if (process.env.NODE_ENV !== 'production') { Component.propTypes = { container: PropTypes.node, children: PropTypes.node.isRequired, plugins: PropTypes.arrayOf(Function), + componentProps: PropTypes.shape({ + className: PropTypes.string, + }), options: PropTypes.shape({ parser: PropTypes.func, skipParse: PropTypes.bool, @@ -27,6 +39,7 @@ Component.defaultProps = { container: 'span', plugins: [], options: {}, + componentProps: {}, }; export default Component;