scrimba
React Bootcamp Course
useState() Part 1 - Creating State
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() Part 1 - Creating State
AboutCommentsNotes
useState() Part 1 - Creating State
Expand for more info
App.js
run
preview
console
import React from "react"

class App extends React.Component {
constructor() {
super()
this.state = {
answer: "Yes"
}
}

render() {
return (
<div>
<h1>Is state important to know? {this.state.answer}</h1>
</div>
)
}
}

export default App
Console
/index.html
-7:18