Unit Testing Reducers
Oct 7, 2020Ensure the reducer returns a valid initial state. Test actions together with their handlers and set these tests up with factory functions. For each action test how it modifies the reducer with initial as well as with populated state. Test selectors in conjunction with the root reducer. Set up selector tests by reducing over actions.More
Higher-Order Components
Feb 6, 2020Higher-order components are functions that take in and return React components. Since their input and output is the same type, they're composable using point-free, declarative function composition. You can use them to abstract or reuse component logic or styling.More
Arrow Functions
Jul 9, 2019Arrow functions are implicitly returning function expressions without `this`.More
Conditional Rendering
Jul 2, 2019|| and && (often) don't return booleans. You need to learn about the operand selector operators, which return either their left or right argument to understand conditional rendering in React.More
useCallback vs useMemo
May 14, 2019With useCallback you can define a function that has referential equality between renders. You can use useMemo to calculate a value that has referential equality between renders. Both only change their return value when their dependencies change.More
- Bonus Posts