Skip to content

Commit

Permalink
feat: Extend children type to supppor null
Browse files Browse the repository at this point in the history
  • Loading branch information
HPouyanmehr committed May 18, 2023
1 parent 6ac156d commit dfd3925
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mui-markdown",
"version": "1.0.0",
"version": "1.0.1",
"private": false,
"author": {
"name": "Hosein Pouyanmehr",
Expand Down
4 changes: 3 additions & 1 deletion package/src/MuiMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const MuiMarkdown: FC<MuiMarkdownProps> = (props) => {
);
}

return <MarkdownRoot options={options}>{children}</MarkdownRoot>;
return (
<MarkdownRoot options={options}>{children ? children : ''}</MarkdownRoot>
);
};

export default MuiMarkdown;
2 changes: 1 addition & 1 deletion package/src/types/muiMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from './highlight';

export interface MuiMarkdownRootProps {
children?: string;
children?: string | null;
prismTheme?: PrismTheme;
codeWrapperStyles?: CSSProperties;
Highlight?: HighlightComponent;
Expand Down

0 comments on commit dfd3925

Please sign in to comment.