Tarekun / optimus-bo-ui

React UI library developed and used at Optimus, Bologna, Italy
0 stars 0 forks source link

Add configuration to showTost function #25

Closed Tarekun closed 2 months ago

Tarekun commented 2 months ago

useToast hook works by returning a Toast to include in the dom and a function to update its state and show it. If you need multiple toasts in a single page you need to call useToast multiple times and render all of the components. I prefer to provide a default configuration when you call the hook that can be recofigured when you actually call shoToast so that you can reuse one single toast for multiple messages of different severity.

AC