DEV Community

Discussion on: 5 tips to improve your React and JS code

idanen profile image
Idan Entin

The logic is decoupled, however not reusable.
So if you need the same logic in, say, Comments component, you'd need to write a CommentsPage.
You can avoid that by changing UserProfilePage to useUserProfile and have it return the user instead of JSX.
Small change, with large benefits