1
0
Fork 0
Browse Source

vault backup: 2022-03-29 15:44:34

master
YuJian 3 years ago
parent
commit
7f5205c74b
  1. 6
      .obsidian/workspace
  2. 4
      随时随地/简单的 React 思考 - Context.md

6
.obsidian/workspace

@ -9,7 +9,7 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "随时随地/简单的 React 思考 - Fiber 创建.md", "file": "随时随地/简单的 React 思考 - Context.md",
"mode": "source", "mode": "source",
"source": false "source": false
} }
@ -69,7 +69,7 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "随时随地/简单的 React 思考 - Fiber 创建.md", "file": "随时随地/简单的 React 思考 - Context.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -89,8 +89,8 @@
}, },
"active": "1508f46ea2481b37", "active": "1508f46ea2481b37",
"lastOpenFiles": [ "lastOpenFiles": [
"随时随地/简单的 React 思考 - Fiber 创建.md",
"随时随地/简单的 React 思考 - Context.md", "随时随地/简单的 React 思考 - Context.md",
"随时随地/简单的 React 思考 - Fiber 创建.md",
"基于 React Hook 开发的 Jira 系统/React 状态管理工具的简单思考.md", "基于 React Hook 开发的 Jira 系统/React 状态管理工具的简单思考.md",
"随时随地/简单的 React 思考 - Hook.md", "随时随地/简单的 React 思考 - Hook.md",
"随时随地/React Hooks 的碎片记录.md", "随时随地/React Hooks 的碎片记录.md",

4
随时随地/简单的 React 思考 - Context.md

@ -4,7 +4,7 @@
### React.createContext ### React.createContext
```javascript ```javascript
const MyContext = React.createContext(default) const MyContext = React.createContext(defaultValue)
``` ```
createContext 会创建一个 createContext 会创建一个 Context 对象,订阅了这个 Context 会在组件树中查找离自己最近的 Provider 中读取到 Context 值,只有在找不到
Loading…
Cancel
Save