onClose

abstract var onClose: (event: SyntheticEvent<*, *>?, reason: SnackbarCloseReason) -> Unit?(source)

Callback fired when the component requests to be closed. Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop. The reason parameter can optionally be used to control the response to onClose, for example ignoring clickaway.

Parameters

{string} reason Can be: "timeout" (autoHideDuration expired), "clickaway", or "escapeKeyDown".