Notes

  • Can accept an initial state
  • Returns two values: current state (name) , state updater function (setName)

Syntax

Import

import { useState } from "react";

Initialize

const [color, setColor] = useState("");