Skip to content

Commit

Permalink
[Dialog] Fix TypeScript type for children (#20450)
Browse files Browse the repository at this point in the history
  • Loading branch information
NMinhNguyen authored Apr 7, 2020
1 parent e751e90 commit a685203
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/material-ui/src/Dialog/Dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface DialogProps
/**
* Dialog children, usually the included sub-components.
*/
children: React.ReactNode;
children?: React.ReactNode;
/**
* If `true`, clicking the backdrop will not fire the `onClose` callback.
*/
Expand Down
6 changes: 6 additions & 0 deletions packages/material-ui/src/Dialog/Dialog.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react';
import { Dialog } from '@material-ui/core';

function optionalChildrenTest() {
<Dialog open />;
}

0 comments on commit a685203

Please sign in to comment.