Member-only story

How to Apply Interface Segregation Principle in ReactJS

SOLID principles in action

Mohammad Faisal
Better Programming
3 min readApr 29, 2021

--

Photo by Bruno Cervera from Pexels

SOLID is a set of principles that are not specific to any framework or language. These principles help us to understand how to write beautiful applications for our customers.

Today we will talk about the fourth principle of SOLID:

I: Interface Segregation Principle

We will try to understand the underlying concept of this principle and implement it in the context of ReactJS.

Previous Articles in this Series

  1. Single Responsibility Principle
  2. Open Closed Principle
  3. Liskov Substitution Principle
  4. Dependency Inversion Principle

What’s This Principle All About?

According to Stackify, the Interface Segregation Principle says

Clients should not be forced to depend upon interfaces that they do not use

In ReactJS we don’t use any interface, at least not in the sense of object-oriented programming. So the main takeaway for this scenario is:

Components should not depend on

--

--

Responses (6)

Write a response