useState hook (Destructuring examples)

PHOTO EMBED

Tue Dec 26 2023 22:31:29 GMT+0000 (Coordinated Universal Time)

Saved by @Marcelluki

const [rating, setRating] = React.useState(0); // -1, 0 or 1
const [isBlocked, setIsBlocked] = React.useState(false); // true or false
const [notes, setNotes] = React.useState(['no notes yet']); // an array of strings 
content_copyCOPY

https://tripleten.com/trainer/web/lesson/46460f66-7574-4d1b-a269-8e5c08776b78/