Create local component state.
Section: State Hooks
useState basic state
tsx
tsx
const [count, setCount] = useState(0);Explanation
Use `useState` when state updates are straightforward and local to a component.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing State Hooks