17 Matching Annotations
  1. Oct 2020
    1. When using React hooks there is no concept of onMount because the idea of only running some code on mount leads to writing non-resilient components, components that do one thing when they mount, and then don’t take prop changes into account.
    2. A component shouldn’t break because it’s rendered more or less often.
    3. Keep the local state isolated.Think about which state is local to a particular UI representation — and don’t hoist that state higher than necessary.
    4. Props and state can change, and components should handle those changes whenever they happen.
    5. Even if a component is rendered just once, your design will improve if rendering twice doesn’t break it.
  2. Sep 2020
  3. Dec 2019
  4. Oct 2019
  5. Sep 2019
  6. Aug 2019