Skip to content

Toast: How to find out when a user has closed Toast #3177

Discussion options

You must be logged in to vote

You can use the callback onRemove to monitor when Toad is hide in general. Then use the pt > closeButton, to add an onClick event so you can monitor when the user actively clicked on the button. Here is a sample:

Sample

<Toast
      ref={toast}
      onHide={onHide}
      onRemove={onRemove}
      pt={{
        closeButton: {
          onClick: () => {
            onClickClose();
          },
        },
      }}
/>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by melloware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants