DEV Community 👩‍💻👨‍💻

Discussion on: Build a react-router clone from scratch

Collapse
 
adnanaslam profile image
Adnan Aslam

useCallback() hook is used to capture the whole function just a way to optimize the performance like as memoisation.

useCallback() used in conjunction with useEffect() because it allows you to prevent the re-creation of a function.

I hope this information helps you in understanding the useCallback() hook in react.

@Cheers
adnanaslam

Collapse
 
harshilparmar profile image
Harshil Parmar

Thanks brother!!