mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): correct grammar in React state and hooks review (#64588)
This commit is contained in:
+2
-2
@@ -51,8 +51,8 @@ function handleDelete(id) {
|
||||
|
||||
## Working with State and the `useState` Hook
|
||||
|
||||
- **Definition for state**: In React, state is a object that contains data for a component. When the state updates the component will re-render. React treats state as immutable, meaning you should not modify it directly.
|
||||
- **`useState()` Hook**: The `useState` hook is a function that lets you declare state variables in functional components. Here is an basic syntax:
|
||||
- **Definition for state**: In React, state is an object that contains data for a component. When the state updates the component will re-render. React treats state as immutable, meaning you should not modify it directly.
|
||||
- **`useState()` Hook**: The `useState` hook is a function that lets you declare state variables in functional components. Here is the basic syntax:
|
||||
|
||||
```js
|
||||
const [stateVariable, setStateFunction] = useState(initialValue);
|
||||
|
||||
Reference in New Issue
Block a user