项目
在 GitHub 查看
ipenywis/react-solid
关于
用于编写整洁代码的 React S.O.L.I.D 原则
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文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 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>
);
}
探索相关项目
加载中…