diff --git a/ActionButton.js b/ActionButton.js index ec1b9e3..57c6651 100644 --- a/ActionButton.js +++ b/ActionButton.js @@ -278,44 +278,49 @@ const ActionButton = props => { }, 250); }; - return ( - - - {props.backdrop} - - - {active && !props.backgroundTappable && _renderTappableBackground()} - - {props.verticalOrientation === "up" && - props.children && - _renderActions()} - {_renderMainButton()} - {props.verticalOrientation === "down" && - props.children && - _renderActions()} + if (this.props.visible) { + return ( + + + {props.backdrop} + + + {active && !props.backgroundTappable && _renderTappableBackground()} + + {props.verticalOrientation === "up" && + props.children && + _renderActions()} + {_renderMainButton()} + {props.verticalOrientation === "down" && + props.children && + _renderActions()} + - - ); + ); + } else { + return (null); + } }; ActionButton.Item = ActionButtonItem; ActionButton.propTypes = { + visible: PropTypes.bool, resetToken: PropTypes.any, active: PropTypes.bool, @@ -362,6 +367,7 @@ ActionButton.propTypes = { }; ActionButton.defaultProps = { + visible: true, resetToken: null, active: false, bgColor: "transparent",