https://github.com/ipenywis/react-solid
React S.O.L.I.D Principles for writing clean-code
https://github.com/ipenywis/react-solid
Last synced: 4 months ago
JSON representation
React S.O.L.I.D Principles for writing clean-code
- Host: GitHub
- URL: https://github.com/ipenywis/react-solid
- Owner: ipenywis
- Created: 2022-11-21T11:33:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T14:12:46.000Z (over 1 year ago)
- Last Synced: 2024-08-13T07:17:07.208Z (8 months ago)
- Language: TypeScript
- Size: 145 KB
- Stars: 525
- Watchers: 8
- Forks: 180
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - ipenywis/react-solid - React S.O.L.I.D Principles for writing clean-code (TypeScript)
README
# React S.O.L.I.D Principles for writing clean-code

- SRP: Single Responsibility Principle
- OCP: Open-Closed Principle
- LSP: Liskov Substitution Principle
- ISP: Interface Segregation Principle
- DIP: Dependency Inversion PrincipleAll 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:
```bash
yarn install
yarn dev
```Change the component in `App.tsx` with the corresponding Principle's component name to see the demo.
### Example
```tsx
function App() {
return (
{/* */}
{/* */}
{/* */}
);
}
```