Skip to content

Commit 5739d25

Browse files
committed
revert commit
1 parent 48ffbbd commit 5739d25

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

docs/examples/dynamic-extra.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import '../../assets/index.less';
3-
import type { TabsProps } from '../../src';
42
import Tabs from '../../src';
3+
import type { TabsProps } from '../../src';
4+
import '../../assets/index.less';
55

66
const items: TabsProps['items'] = [];
77
for (let i = 0; i < 50; i += 1) {
@@ -16,20 +16,22 @@ export default () => {
1616

1717
const extra = React.useMemo(() => {
1818
if (key === '0') {
19-
return <div>额外内容</div>;
20-
}
21-
return null;
22-
}, [key]);
19+
return (
20+
<div>额外内容</div>
21+
)
22+
}
23+
return null
24+
}, [key])
2325

2426
return (
2527
<div style={{ maxWidth: 550 }}>
26-
<Tabs
28+
<Tabs
2729
activeKey={key}
28-
onChange={curKey => setKey(curKey)}
29-
tabBarExtraContent={extra}
30-
defaultActiveKey="8"
31-
items={items}
30+
onChange={(curKey) => setKey(curKey)}
31+
tabBarExtraContent={extra}
32+
defaultActiveKey="8"
33+
items={items}
3234
/>
3335
</div>
3436
);
35-
};
37+
};

0 commit comments

Comments
 (0)