scrimba
Learn React for free
React Conditional Render Practice
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 Practice
AboutCommentsNotes
React Conditional Render Practice
Expand for more info
App.js
run
preview
console
import React from "react"

/*
Challenge:

Given a stateless functional component:
1. Follow the steps necessary to add state to it,
2. Have state keep track of whether the user is logged in or not
3. Add a button that logs the user in/out
a. extra challenge - make the button display "log in" if they're not logged in and "log out" if they are
4. Display text that says "Logged in" if the user is logged in, or "Logged out" if they're not.
*/

function App() {
return (
<div>
Code goes here
</div>
)
}

export default App
Console
index.html
-8:32