1 | import * as React from 'react';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | function StaticContainer(props) {
|
7 | return props.children;
|
8 | }
|
9 |
|
10 | export default React.memo(StaticContainer, (prevProps, nextProps) => {
|
11 | const prevPropKeys = Object.keys(prevProps);
|
12 | const nextPropKeys = Object.keys(nextProps);
|
13 |
|
14 | if (prevPropKeys.length !== nextPropKeys.length) {
|
15 | return false;
|
16 | }
|
17 |
|
18 | for (const key of prevPropKeys) {
|
19 | if (key === 'children') {
|
20 | continue;
|
21 | }
|
22 |
|
23 | if (prevProps[key] !== nextProps[key]) {
|
24 | return false;
|
25 | }
|
26 | }
|
27 |
|
28 | return true;
|
29 | });
|
30 |
|
\ | No newline at end of file |