diff --git a/lib/ToastContainer.js b/lib/ToastContainer.js index a661d5c..5cfc3be 100644 --- a/lib/ToastContainer.js +++ b/lib/ToastContainer.js @@ -76,6 +76,7 @@ class ToastContainer extends Component { textStyle: Text.propTypes.style, delay: PropTypes.number, hideOnPress: PropTypes.bool, + onPress: PropTypes.func, onHide: PropTypes.func, onHidden: PropTypes.func, onShow: PropTypes.func, @@ -208,6 +209,11 @@ class ToastContainer extends Component { } }; + _hideOnPress = () => { + this.props.onPress && this.props.onPress(); + this._hide(); + } + render() { let {props} = this; const { windowWidth } = this.state; @@ -227,7 +233,7 @@ class ToastContainer extends Component { pointerEvents="box-none" >