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("");
Notes
- Can accept an initial state
- Returns two values: current state (name) , state updater function (setName)
import { useState } from "react";
const [color, setColor] = useState("");