---
title: "Comment by Nik Sumeiko on \"Improving testability of your react components\" | Hashnode"
description: "Hi Kristijan, pure functions handling business logic and smaller components are very useful software design concepts. Both also help to comply with a Single Res"
url: "https://hashnode.com/posts/improving-testability-of-your-react-components/60256435c6d91052dafe8c55/comment/604a9956ad1cac7d577dfb67"
---

[Discussion](https://hashnode.com/posts/improving-testability-of-your-react-components/60256435c6d91052dafe8c55)

Comment [Improving testability of your react components](https://hashnode.com/posts/improving-testability-of-your-react-components/60256435c6d91052dafe8c55)

[Nik Sumeiko](https://hashnode.com/@niksumeiko)

[Mar 11, 2021](https://hashnode.com/posts/improving-testability-of-your-react-components/60256435c6d91052dafe8c55/comment/604a9956ad1cac7d577dfb67)

Hi Kristijan, pure functions handling business logic and smaller components are very useful software design concepts. Both also help to comply with a Single Responsibility Principle from SOLID. Each unit is doing its own job and has a single reason to change.

We strive to follow this in our huge codebase, too. Now with React hooks, we split it as follows:

1.  React components do just view rendering;
2.  Services (with pure functions inside) handle business logic;
3.  React hooks arranges business logic composition serving the view — they compose service operations.

This way everything is not just granularly separated and easy to test individually, but also very DRY (reusable).
