JavaScript sebastiandedeyne.com

Forget about component lifecycles and start thinking in effects  ↦

Great description of how the Hooks API leads us from an imperative style of implementing side effects (“Do thing x on mount, do thing y on unmount”) to a declarative style of implementing side effects.

Author Sebastian De Deyne puts it this way:

Instead of thinking about when we should apply the side effect, we declare the side effect’s dependencies. This way React knows when it needs to run, update, or clean up.


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00