Skip to content

Commit d20f986

Browse files
authored
fix: make children of FlexBox, Grid, ResponsiveGridLayout and Text optional (#3851)
1 parent 780206a commit d20f986

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed

packages/main/src/components/FlexBox/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface FlexBoxPropTypes extends CommonProps {
4242
/**
4343
* Content of the `FlexBox`.
4444
*/
45-
children: ReactNode | ReactNode[];
45+
children?: ReactNode | ReactNode[];
4646
/**
4747
* Sets the components outer HTML tag.
4848
*

packages/main/src/components/Form/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ import { styles } from './Form.jss';
2020

2121
export interface FormPropTypes extends CommonProps {
2222
/**
23-
* Components that are placed into Form. Please use only `FormGroup` and `FormItem` in order to preserve the
24-
* intended design.
23+
* Components that are placed into Form.
24+
*
25+
* __Note:__ Although this prop accepts all HTML Elements, it is strongly recommended that you only use `FormGroup` or `FormItem` in order to preserve the intended design.
2526
*/
2627
children: ReactNode | ReactNode[];
2728
/**

packages/main/src/components/FormGroup/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export interface FormGroupPropTypes {
88
*/
99
titleText: string;
1010
/**
11-
* Contents of the FormGroup. Please use only `FormItem` to keep the intended design.
11+
* Content of the FormGroup.
12+
*
13+
* __Note:__ Although this prop accepts all HTML Elements, it is strongly recommended that you only use `FormItem` in order to preserve the intended design.
1214
*/
1315
children: ReactNode | ReactNode[];
1416
}

packages/main/src/components/Grid/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface GridPropTypes extends CommonProps {
3939
/**
4040
* Components that are placed into Grid layout.
4141
*/
42-
children: ReactNode | ReactNode[];
42+
children?: ReactNode | ReactNode[];
4343
}
4444

4545
const INDENT_PATTERN =

packages/main/src/components/MessageBox/MessageBox.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const MessageBoxComponent = () => {
174174
<Story
175175
name="With Custom Action"
176176
args={{
177-
actions: [MessageBoxActions.OK, 'Custom Action', MessageBoxActions.Cancel, <Button>Custom Button</Button>]
177+
actions: [MessageBoxActions.OK, 'Custom Action', MessageBoxActions.Cancel, <Button key="0">Custom Button</Button>]
178178
}}
179179
>
180180
{(args) => {

packages/main/src/components/ResponsiveGridLayout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface ResponsiveGridLayoutPropTypes extends CommonProps {
5858
* Example: If you want one child to span across 4 columns, you can add this element style to the child element:
5959
* `style={{ gridColumn: 'span 4' }}`
6060
*/
61-
children: ReactNode | ReactNode[];
61+
children?: ReactNode | ReactNode[];
6262
}
6363

6464
const useStyles = createUseStyles(ResponsiveGridLayoutStyles, { name: 'ResponsiveGridLayout' });

packages/main/src/components/Text/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface TextPropTypes extends CommonProps {
88
/**
99
* Pass the text as direct child of Text
1010
*/
11-
children: string | JSX.Element | ReactNode;
11+
children?: ReactNode;
1212
/**
1313
* Defines how white-space inside <code>Text</code> is handled. If set to true, sequences of white space are preserved.
1414
*/

0 commit comments

Comments
 (0)