Great intro! Just want to add that the setX in useState also takes a callback function to ensure you're using the latest state value. So for likes, you could do setLikes((x) => x + 1)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great intro! Just want to add that the
setX
inuseState
also takes a callback function to ensure you're using the latest state value. So for likes, you could dosetLikes((x) => x + 1)