Let’s get down to business

Every react application has components that control child components, using state. Such child components are also known as controlled components. The classical example is Layout component that controls the visibility of modal dialog.

In the real-world app, implementation of toggle function is something that developers must avoid.

Why? Because the Modal dialog might appear in more than one place. That means duplicated code. And that means hard to maintain and extend app.

In this post, I would like to share a piece of functionality that I use to make my components clear and maintainable.