Quickupdate

  • Home
  • Top Trending
    • Top Android Apps
    • Top Ios Apps
  • Featured
  • About Us
  • Contact us
  • Privacy Policy and Disclaimer

Thursday, 24 June 2021

Using the Effect Hook. What is the Effect Hook?

 Developers     June 24, 2021     React     No comments   

Ref: https://reactjs.org/docs/hooks-effect.html

  1. Hooks are a new addition to React 16.8.

  2. They let you use state and other React features without writing a class.

  3. What does useEffect do? By using this Hook, you tell React that your component needs to do something after render.

  4. React will remember the function you passed (we’ll refer to it as our “effect”), and call it later after performing the DOM updates.

  5. Hooks only works in the functional components. so if you want to use useEffect or any other hook you have to use functional components.

  6. use effect keeps calling itself if you specifically do not specify an empty array at the end of the useEffect.
Eg:
useEffect( () => {
    
}, []); // empty array specified

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • How to upload the existing folder on GitHub Or GitLab?
    These are the steps to upload the existing folder on GitHub Or GitLab. Whenever you want to push your existing folder to git or GitHub you m...

Categories

  • FAANG (2)
  • Javascript (6)
  • Node (1)
  • Project Management (1)
  • React (9)
  • SQL (1)
  • Testing (1)

Blog Archive

  • January 2023 (1)
  • January 2022 (1)
  • November 2021 (3)
  • October 2021 (3)
  • August 2021 (1)
  • July 2021 (7)
  • June 2021 (12)
  • February 2021 (1)
  • January 2021 (1)
  • January 2020 (3)
  • August 2019 (3)