Skip to content

Instantly share code, notes, and snippets.

@anmolsukki
Created February 18, 2021 21:07
Show Gist options
  • Save anmolsukki/d6db245c630026a5ee8aca21188aa311 to your computer and use it in GitHub Desktop.
Save anmolsukki/d6db245c630026a5ee8aca21188aa311 to your computer and use it in GitHub Desktop.
[React Js]

React Hooks

What is useCallback Hook?

useCallback is hook that will return a memoized version of callback function that only changes if one of the dependencies has changed.

Why use useCallbak hook?

It is usefull when passing callback to optimized child component that rely on reference equality to prevent unnecessary renders.

What is Custom hooks?

A custom hook is basically a javascript function whose name starts with "use".
A custom hook can also call other Hook if require

Why use custom hooks?

Share Logic- Alternative to HOCs and render props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment