Skip to content
8 changes: 7 additions & 1 deletion lib/ToastContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -227,7 +233,7 @@ class ToastContainer extends Component {
pointerEvents="box-none"
>
<TouchableWithoutFeedback
onPress={this.props.hideOnPress ? this._hide : null}
onPress={this.props.hideOnPress ? this._hideOnPress : null}
>
<Animated.View
style={[
Expand Down