(no title)
codemonkey-zeta | 7 months ago
useState
useState
useState
... // 20 more
useEffect
useEffect
useEffect
... // 20 more
I think a lot of front-end devs don't realize the necessity of custom hooks for composition and modularization. My personal rule is "Never use react hooks (useState, useEffect, etc.) in component code. All react hooks MUST be wrapped by custom hooks." and it makes for MUCH better code:
useSomeData
useOtherData
useMobileView
useScrollToTop
useInteractionLogging
... // 10 more hooks
This is also what makes TanStack so good and popular. It's all just behavior wrapped in hooks.
matsemann|7 months ago
skydhash|7 months ago