-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# React 是什么? | ||
|
||
React 是一个用于构建用户界面的 JavaScript 库, 通过组件化的方式解决视图层复用的问题。 | ||
|
||
它的核心思路是: 声明式、组件化、通用型 | ||
|
||
## 声明式 | ||
相比 JQ 的命令式编程: `$(body).css('color', 'red');`, 声明式编程更加直观、便于复用: | ||
```jsx | ||
const Body = (props) => { | ||
return <div style={{color: 'red'}}>{props.children}</div> | ||
} | ||
``` | ||
|
||
## 组件化 | ||
可以降低功能之间的耦合、提高功能的内聚性,便于复用 | ||
|
||
## 通用性 | ||
虚拟DOM的实现,保证了跨平台和可移植性 | ||
|
||
## 缺点 | ||
没有提供全链路的解决方法,比如 router、数据仓库,需要借助第三方库 |