Skip to content

Commit 593662f

Browse files
committed
doc: Update react.md.
1 parent a5ec6ff commit 593662f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/react.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ React 备忘清单
1212
React 是一个用于构建用户界面的 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'
1818
import {createRoot} from 'react-dom/client'
1919
import App from './App'
2020
```
@@ -46,14 +46,15 @@ import ReactDOM from 'react-dom'
4646
export 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` 组件,在示例中使用。

0 commit comments

Comments
 (0)