using tailwindui notification components

how to use the tailwindui notification to be use other components(passing message and show boolean)
3 Replies
Lopen
Lopen2y ago
Read reactjs doc on Props This seems like it does what you're asking for Just call the component like this
<Notify messageHead="this is the message header" messageBody= " this is the message body" show=true />
<Notify messageHead="this is the message header" messageBody= " this is the message body" show=true />
arete
arete2y ago
but when i close it nothing happen
Lopen
Lopen2y ago
Yes because the show is fixed You need to use state to set the show example
const [show, setShow] = useState(false)
<Notify messageHead="this is the message header" messageBody= " this is the message body" show=show />
const [show, setShow] = useState(false)
<Notify messageHead="this is the message header" messageBody= " this is the message body" show=show />
So look for how to manipulate your useState your fine You can use useEffect to do this So when the notify is triggered use timer and then clean after your self
Want results from more Discord servers?
Add your server