Add the hooks docs

pull/1465/head
Kamran Ahmed 2 years ago
parent 9e08eb1a98
commit dc451e68fc
  1. 8
      content/roadmaps/103-react/content/100-react-fundamental-topics/108-basic-hooks/100-use-state.md
  2. 7
      content/roadmaps/103-react/content/100-react-fundamental-topics/108-basic-hooks/101-use-effect.md
  3. 8
      content/roadmaps/103-react/content/100-react-fundamental-topics/108-basic-hooks/readme.md

@ -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…
Cancel
Save