File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ React 备忘清单
1212React 是一个用于构建用户界面的 JavaScript 库。
1313
1414- [ React 官方文档] ( https://reactjs.org/ ) _ (reactjs.org)_
15+ - [ Styled Components 备忘清单] ( ./styled-components.md ) _ (jaywcjlove.github.io)_
1516
1617``` js
17- import React from ' react'
1818import {createRoot } from ' react-dom/client'
1919import App from ' ./App'
2020```
@@ -46,14 +46,15 @@ import ReactDOM from 'react-dom'
4646export class Hello extends Component {
4747 ...
4848}
49+ export default function World () {
50+ /* ... */
51+ }
4952```
5053
51- 使用 ` export ` 或者 ` export default ` 导出 ` Hello ` 组件
54+ 使用 ` export ` 导出 ** ` Hello ` ** , ` export default ` 导出 ** ` World ` ** 组件
5255
5356``` jsx
54- import { Hello } from ' ./hello.js' ;
55-
56- const Example = < Hello / > ;
57+ import World , { Hello } from ' ./hello.js' ;
5758```
5859
5960使用 ` import ` 导入 ` Hello ` 组件,在示例中使用。
You can’t perform that action at this time.
0 commit comments