Комментарии:
This is much cleaner and it also allows you to unit test the hook - yes you will have more files to manage but you at least get like you say, a decoupled entity
Ответитьto make your code step up to the next level you could finally use typescript
ОтветитьThis is exactly how i started writing my react applications...
It really makes your code cleaner
thanks for the video
what's your vscode theme name?
Alright so...
Ответить{2022-08-08}
ОтветитьHow would you handle multiple api calls that depend on each other? Just curious
ОтветитьGreat. I would love to see how you abstract even further the pagination with a hook`usePagination`. I have seen myself using that pattern before where I return page, handleNextPage/handlePreviousPage.
ОтветитьEver since I learned react and Nextjs, I've started to use that approach. I find it to be a great way to design your web application
ОтветитьI do something similar for some of my code for calls to CMSes....
ОтветитьJust moving the problem to another file. It won't help from refactoring.
ОтветитьAre you using ATOM as your IDE?
Ответитьthe only custom hook I used is a useAuth hook to check if the user is authenticated, and if he has the correct role to access certain routes/actions.
ОтветитьGood job babe!!!!
Ответить