News for hackers. Stuff that matters.
Re:React Best Practices for 2021 by koblas on Saturday February 13, 2021 @01:20PM (#26125427)
Really wish the author had gone all in on hook patterns rather than start with component patterns and make a transition.

1. Use TypeScript to catch errors early

2. Use hooks

3. Build your data access layer as custom hooks -- e.g. const { isLoggedIn, loggin } = useAuth();

4. Tips on refactoring to have testable components

5. Understand when to use memoization -- expensive is in the eye of the beholder.

There are no comments on this comment yet.