scrimba
Learn React for free
React Conditional Render
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

React Conditional Render
AboutCommentsNotes
React Conditional Render
Expand for more info
App.js
run
preview
console
import React, {Component} from "react"
import Conditional from "./Conditional"

class App extends Component {
constructor() {
super()
this.state = {
isLoading: true
}
}

componentDidMount() {
setTimeout(() => {
this.setState({
isLoading: false
})
}, 1500)
}

render() {
return (
<div>
<Conditional isLoading={this.state.isLoading}/>
</div>
)
}
}

export default App
Console
index.html
-11:14