scrimba
Reusable React
Fundamentals
Fundamentals Exercise: Badge Component
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

Fundamentals Exercise: Badge Component
AboutCommentsNotes
Fundamentals Exercise: Badge Component
Expand for more info
index.js
run
preview
console
import React from 'react';
import ReactDOM from 'react-dom';

const Badge = () => {
return <span>Hello, world!</span>
}

const App = () => {
return (
<section>
<h1>Check out these badges!</h1>
<Badge color="green">Success</Badge> This is operational. <br />
<Badge color="red">Removed</Badge> This is critical. <br />
<Badge color="yellow">Warning</Badge> This is a warning. <br />
<Badge color="blue">Beta</Badge> This is in progress. <br />
</section>
)
}

const domElement = document.getElementById('root')
ReactDOM.render(<App />, domElement)
Console
/index.html
-4:17