Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for 5 key takeaways from React Hooks
Ifeanyi Chima
Ifeanyi Chima

Posted on • Edited on

5 key takeaways from React Hooks

If you follow the great tech youtuberDave Gray He has a series where he breaks down react hooks.

In this article, I will mention five key takeaways that will help you understand react hooks better.

1Referential Equality:
This means when react goes to reference that function in memory, it is the same one and not a new one.

2useCallback:
This preserves a function, so that everytime the component re-renders, the function will not get re-created by react. i.e. We are giving the functionreferential equality

3useMemo:
This preserves the result of a function that is called, so that it does not have to be re-calculated everytime the component re-renders.

4useRef:
Its' value stays the same even after a change in state causes the component to re-render.

5useLayoutEffect:
It is kind of the same as useEffect, but its' side effect must finish running before it will paint to the DOM.

Note:side effect is the code inside useLayoutEffect

Thank you, please follow me

Buy Me A Coffee

HTML GitHub

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I write articles to teach the world what I know.
  • Location
    Lafayette, Louisiana, USA
  • Education
    Bachelor of Science, Computer science
  • Pronouns
    he/him
  • Work
    Software Developer / Designer
  • Joined

More fromIfeanyi Chima

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp