/compound-components

Demonstration of refactoring a yucky component into a delicious menu by employing the react compound components pattern.

Primary LanguageTypeScript

Compound Components

Demonstrates a refactoring of a YuckyMenu into a DeliciousMenu by employing the React Compound Components pattern along with some other patterns.

Still a bit rough around the edges.

React Compound Components is a pattern that can be employed to create composable components that can share some state.

It promotes:

  • Loosely coupled lightweight components.
  • Flexibility in regards to customisation of styles, rendering behaviour.
  • A better developer experience, more comprehendible.
  • Reuse of existing components.