Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

usestate hook with prevstate

const [count, setCount] = useState(0) // count = 0
setCount(prevCount => prevCount + 1) // count = 1
 
PREVIOUS NEXT
Tagged: #usestate #hook #prevstate
ADD COMMENT
Topic
Name
2+9 =