DEV Community

Discussion on: Demystifying React Hooks: useCallback and useMemo

Collapse
 
milu_franz profile image
Milu • Edited

Hello there! The only reason I can think of is that whoever is implementing the code, does not want their handleFormSubmit() function to be created every time the component re-renders. I found this article where they use the useCallback() hook in a handleFormSubmit() to stop tree invalidation issues. However, I haven't encountered issues when creating a form without using useCallback in the past.