chrisirhc


Composability within React Components

When building a complex React component, it’s important to keep in mind what makes a component maintainable, testable, reusable.

It’s helpful to think of React components as functions. When functions gets too large, it makes sense to refactor and think about how it can be broken down to a composition of smaller functions.

Some of the benefits of breaking down the render method of a React into smaller components are:

Don’t these items sound familiar? They should, because it’s the same reasons behind refactoring large functions into smaller functions.

Related references:

comments powered by Disqus