You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# 简单的 React 思考 - Context
|
|
|
|
关于 React 中 Context 作为状态管理工具的思考具体可以这一篇 [[React 状态管理工具的简单思考]]
|
|
|
|
这里主要是对 Context API 的简单记录
|
|
|
|
|
|
|
|
### React.createContext
|
|
|
|
```javascript
|
|
|
|
const MyContext = React.createContext(default)
|
|
|
|
```
|
|
|
|
|
|
|
|
createContext 会创建一个
|