Skip to content

React S.O.L.I.D Principles for writing clean-code

Notifications You must be signed in to change notification settings

sujoyduttajad/react-solid

 
 

Repository files navigation

DO NOT DELETE

This repo showcases the examples of a Typescript react app with SOLID principles

React S.O.L.I.D Principles for writing clean-code

SOLID Principles

  • SRP: Single Responsibility Principle
  • OCP: Open-Closed Principle
  • LSP: Liskov Substitution Principle
  • ISP: Interface Segregation Principle
  • DIP: Dependency Inversion Principle

All the principles are explained on CoderOne's youtube channel: https://youtu.be/MSq_DCRxOxw

Code

This Repo has examples for all principles implemented in React. Go inside src/principle there will be all principles there with isolated demos.

You can run the dev server using:

yarn install
yarn dev

Change the component in App.tsx with the corresponding Principle's component name to see the demo.

Example

function App() {
  return (
    <div className="flex min-w-full h-full justify-center items-center p-8">
      {/* <SRP /> */}
      {/* <OCP /> */}
      {/* <LSP /> */}
      <DIP />
    </div>
  );
}

About

React S.O.L.I.D Principles for writing clean-code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 86.9%
  • CSS 7.8%
  • JavaScript 3.8%
  • HTML 1.5%