Custom Hook on Button Click (onClick POST with useFetch) - React Tutorial 53

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

Рекомендации по теме
Комментарии
Автор

Dude, loved this! I’m refactoring my code with custom hooks and I was struggling with calling an api inside my custom hook only on button click. This is exactly the concept I had to learn, which was to return functions that can be triggered in useEffect!! Thanks a lot and keep it up!

guiics
Автор

(fix): at 17:39 be sure to leave an empty dependency array for the useEffect!


codebreakthrough
Автор

I really like your explanation, can i get the code sir? thanks

finn
Автор

Hi caleb, there is a network of bots spamming a scam in your comment section. Account name is gwen noah, i hope you can delete the comment. Good video after all!

asteriks_hardcore