Is it possible to create this as a react hook (useToaster) or global function? So you can have a singleton high up in the app structure and you just call toastGlobal.current.show('Task finished successfully', { type: 'success' }) Then you don't need to have the <Toast/> component everywhere in your app.
Hey thanks for the awesome library. I was wondering if i have a toast globally, is there a way I could then call a function toast.show within some redux code? (maybe a thunk or a saga)
4
u/DjWithNoNameYet Sep 08 '20
Is it possible to create this as a react hook (useToaster) or global function? So you can have a singleton high up in the app structure and you just call toastGlobal.current.show('Task finished successfully', { type: 'success' }) Then you don't need to have the <Toast/> component everywhere in your app.