scrimba
Frontend Career Path
React basics
Meme generator
useState array destructuring
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

useState array destructuring
AboutCommentsNotes
useState array destructuring
Expand for more info
App.js
run
preview
console
import React from "react"

export default function App() {
const result = React.useState("Yes")
console.log(result)
return (
<div className="state">
<h1 className="state--title">Is state important to know?</h1>
<div className="state--value">
<h1>{result[0]}</h1>
</div>
</div>
)
}
Console
[
"Yes"
,
ƒ()
]
,
/index.html
-1:46