scrimba
Reusable React
Components & refs
Building an interactive form
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

Building an interactive form
AboutCommentsNotes
Building an interactive form
Expand for more info
index.js
run
preview
console
import React, { useState } from 'react';
import ReactDOM from 'react-dom';

const App = () => {
const [count, setCount] = useState(0)

return (
<section>
<h2>Counter: The Most Novel Example I Could Come Up With</h2>
<div className="counter">
<button>-</button>
<input
type="text"
aria-label="count"
defaultValue={count}
/>
<button>+</button>
</div>
</section>
)
}
ReactDOM.render(<App />, document.getElementById('root'));
Console
/index.html?
-3:48