Skip to content

Hands on with Next.js

Posted on:November 3, 2023

Hands on with Next.js


1. Build a little counter app

JavaScript Basics:


Add the following code to <button>:

  onClick={() => {
    number++;
  }}

Why doesn’t it work?


const [number, setNumber] = useState(0);

Imperative vs Declarative


2. Build a to-do app

Think about how to solve the problem:



3. Refactor the frameworks page


Define a component:

function MyComponent(props) {
  return <div>{props.text}</div>;
}