You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a wrapper for useSnackbar with some defaults and additions in our project, and since we're using Typescript I want the typings to be correct. And in the notistack typings there's a thing I don't quite understand:
The enqueueSnackbar function is typed to return OptionsObject['key'] | null, while closeSnackbar can only accept OptionsObject['key'].
In what sort of cases does enqueueSnackbar return null? 🤔
I'm creating a wrapper for
useSnackbar
with some defaults and additions in our project, and since we're using Typescript I want the typings to be correct. And in the notistack typings there's a thing I don't quite understand:The
enqueueSnackbar
function is typed to returnOptionsObject['key'] | null
, whilecloseSnackbar
can only acceptOptionsObject['key']
.In what sort of cases does
enqueueSnackbar
returnnull
? 🤔https://github.com/iamhosseindhv/notistack/blob/master/src/index.d.ts#L35-L38
I've tried to figure it out from the documentation and looking in the source, but couldn't really find it... 😕
The text was updated successfully, but these errors were encountered: