Stateful vs Stateless Components

Stateful

  • When you need internal state

    • D3 graph

  • When you need to utilize a Component Lifecycle hook

    • Ajax request on mount

      • Setup animations

      • Access the raw DOM node for a 3rd party library

Stateless

95% of the time all you need is a stateless component.