Skip to content

Commit cc5a54a

Browse files
committed
fix: change children PropType to node or [node]
1 parent b33dfa0 commit cc5a54a

File tree

4 files changed

+46
-44
lines changed

4 files changed

+46
-44
lines changed

demo/demo.jsx

+43-41
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,49 @@ import { DropdownExamples } from './DropdownExamples';
1414
ReactDOM.render(
1515
<div className="mt-3">
1616
<React.StrictMode>
17-
<ToastsContainer>
18-
<StatefulTabs
19-
vertical={true}
20-
onlyRenderActiveTab={true}
21-
initialTab={2}
22-
tabs={[
23-
{
24-
title: 'Dialog',
25-
content: <DialogExamples />,
26-
},
27-
{
28-
title: 'Dropdown',
29-
content: <DropdownExamples />,
30-
},
31-
{
32-
title: 'Forms',
33-
content: <FormExamples />,
34-
},
35-
{
36-
title: 'List groups',
37-
content: <ListGroupExamples />,
38-
},
39-
{
40-
title: 'Pagination',
41-
content: <PaginationExamples />,
42-
},
43-
{
44-
title: 'Tables',
45-
content: <TableExamples />,
46-
},
47-
{
48-
title: 'Tabs',
49-
content: <TabsExamples />,
50-
},
51-
{
52-
title: 'Toasts',
53-
content: <ToastsExamples />,
54-
},
55-
]}
56-
/>
57-
</ToastsContainer>
17+
<StatefulTabs
18+
vertical={true}
19+
onlyRenderActiveTab={true}
20+
initialTab={7}
21+
tabs={[
22+
{
23+
title: 'Dialog',
24+
content: <DialogExamples />,
25+
},
26+
{
27+
title: 'Dropdown',
28+
content: <DropdownExamples />,
29+
},
30+
{
31+
title: 'Forms',
32+
content: <FormExamples />,
33+
},
34+
{
35+
title: 'List groups',
36+
content: <ListGroupExamples />,
37+
},
38+
{
39+
title: 'Pagination',
40+
content: <PaginationExamples />,
41+
},
42+
{
43+
title: 'Tables',
44+
content: <TableExamples />,
45+
},
46+
{
47+
title: 'Tabs',
48+
content: <TabsExamples />,
49+
},
50+
{
51+
title: 'Toasts',
52+
content: (
53+
<ToastsContainer>
54+
<ToastsExamples />,
55+
</ToastsContainer>
56+
),
57+
},
58+
]}
59+
/>
5860
</React.StrictMode>
5961
</div>,
6062
document.getElementById('root')

src/dialog/ModalPortal.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ export function ModalPortal({ children, isOpen }) {
3939
}
4040

4141
ModalPortal.propTypes = {
42-
children: PropTypes.any,
42+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
4343
};

src/forms/FormGroup.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FormGroup.defaultProps = {
2626
};
2727

2828
FormGroup.propTypes = {
29-
children: PropTypes.element,
29+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
3030
feedback: PropTypes.bool,
3131
mockInvalidSibling: PropTypes.bool,
3232
name: PropTypes.string.isRequired,

src/toasts/ToastsContainer.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ToastsContainer.defaultProps = {
2626
};
2727

2828
ToastsContainer.propTypes = {
29-
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
29+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
3030
noStyle: PropTypes.bool,
3131
unique: PropTypes.bool,
3232
};

0 commit comments

Comments
 (0)