scrimba
Learn React Hooks in one hour
useEffect
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
useEffect
Expand for more info
Playground.js
run
preview
console
import React, { useState } from 'react'
import randomColor from 'randomcolor'

export default function Playground() {
const [count, setCount] = useState(0)
return (
<div>
{count}
<button onClick={() => setCount(currentCount => currentCount - 1)}>-</button>
<button onClick={() => setCount(currentCount => currentCount + 1)}>+</button>
</div>
)
}
Console
index.html
-3:45