File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 258258- [ context] ( ./react/context.md )
259259- [ concurrent-mode] ( ./react/concurrent-mode.md )
260260- [ Hooks] ( ./react/Hooks.md )
261+ - [ Others] ( ./react/Others.md )
261262
262263
263264## 常见问题及解答
Original file line number Diff line number Diff line change 1+ ``` js
2+ import isValidElementType from ' shared/isValidElementType' ;
3+ import warningWithoutStack from ' shared/warningWithoutStack' ;
4+
5+ export default function memo<Props> (
6+ type : React$ElementType ,
7+ compare ?: (oldProps : Props , newProps : Props ) => boolean ,
8+ ) {
9+ if (__DEV__ ) {}
10+ return {
11+ $$typeof: REACT_MEMO_TYPE ,
12+ type,
13+ compare: compare === undefined ? null : compare,
14+ }
15+ }
16+
17+ // Fragment: REACT_FRAGMENT_TYPE
18+ // StrictMode: REACT_STRICT_MODE_TYPE
19+ // ReactElement
20+ ```
You can’t perform that action at this time.
0 commit comments