1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-02-24 11:33:09 +01:00

Add the hooks docs

This commit is contained in:
Kamran Ahmed 2022-08-12 19:48:32 +04:00
parent e789249be3
commit 7856d018c5
3 changed files with 20 additions and 3 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>