Hooks are a great abstraction model


The discussion explores the separation of concerns between logic (Model) and UI (View) and how React hooks are a great abstraction model that help achieve that.

We'll start with designing a component's API (in a top down approach), then dive deeper to explore how to implement this API, while maintaining a good separation of concerns.

We'll create custom React hooks to implement the Model and React components for the UI. Both expose self-documenting APIs and are completely decoupled from each other.

To demo this approach, we'll create a simple Toggler component (a UI component that allows going back and forth in an array of values).

Towards the end, we'll explore the benefits, focusing on testing these decoupled units in isolation.

13 min
31 Aug, 2021

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Workshops on related topic