diff --git a/README.md b/README.md index 0c9c629..108a0b1 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ export default class RelativePortal extends React.Component { children: PropTypes.any.isRequired, // portal content onOutClick: PropTypes.func, // called when user click outside portal element component: PropTypes.string.isRequired, // dom tagName + componentClass: PropTypes.string, // dom class for tagName }; static defaultProps = { diff --git a/src/RelativePortal.js b/src/RelativePortal.js index 4b92a6e..d4c2e05 100644 --- a/src/RelativePortal.js +++ b/src/RelativePortal.js @@ -57,6 +57,7 @@ export default class RelativePortal extends React.Component { children: PropTypes.any, onOutClick: PropTypes.func, component: PropTypes.string.isRequired, + componentClass: PropTypes.string, }; static defaultProps = { @@ -98,7 +99,7 @@ export default class RelativePortal extends React.Component { } render() { - const { component: Comp, top, left, right, fullWidth, ...props } = this.props; + const { component: Comp, top, left, right, fullWidth, componentClass, ...props } = this.props; const fromLeftOrRight = right !== undefined ? { right: this.state.right + right } : @@ -109,6 +110,7 @@ export default class RelativePortal extends React.Component { return ( { this.element = element; }}