parent
9e08eb1a98
commit
dc451e68fc
3 changed files with 20 additions and 3 deletions
@ -1 +1,7 @@ |
||||
# Use state |
||||
# useState Hook |
||||
|
||||
`useState` hook is used to manage the state of a component in functional components. Calling `useState` returns an array with two elements: the current state value and a function to update the state. |
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://reactjs.org/docs/hooks-state.html'>Using the State Hook</BadgeLink> |
||||
|
||||
|
@ -1 +1,6 @@ |
||||
# Use effect |
||||
# useEffect Hook |
||||
|
||||
`useEffect` is a special hook that lets you run side effects in React. It is similar to componentDidMount and componentDidUpdate, but it only runs when the component (or some of its props) changes. |
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://reactjs.org/docs/hooks-effect.html'>Using the Effect Hook</BadgeLink> |
||||
|
@ -1 +1,7 @@ |
||||
# Basic hooks |
||||
# React Hooks |
||||
|
||||
Hooks were introduced in React 16.8 and they let us use state and other React features without writing a class |
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://reactjs.org/docs/hooks-intro.html'>Introduction to Hooks</BadgeLink> |
||||
|
||||
|
Loading…
Reference in new issue