Skip to content

Commit db2bcf1

Browse files
committed
eliminate a use of defaultProps (it is deprecated)
1 parent f94b719 commit db2bcf1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/packages/frontend/components/markdown.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
import React from "react";
7-
86
import { HTML } from "./html";
97
import { markdown_to_html } from "../markdown";
108
import { Props as HTMLProps } from "./html";
@@ -14,7 +12,7 @@ type Props = HTMLProps & {
1412
line_numbers?: boolean;
1513
};
1614

17-
export const Markdown: React.FC<Props> = (props) => {
15+
export function Markdown(props: Props) {
1816
function to_html() {
1917
if (!props.value) {
2018
return;
@@ -36,15 +34,13 @@ export const Markdown: React.FC<Props> = (props) => {
3634
className={props.className}
3735
href_transform={props.href_transform}
3836
post_hook={props.post_hook}
39-
safeHTML={props.safeHTML}
37+
safeHTML={props.safeHTML ?? true}
4038
reload_images={props.reload_images}
4139
smc_image_scaling={props.smc_image_scaling}
42-
highlight_code={props.highlight_code}
40+
highlight_code={props.highlight_code ?? true}
4341
content_editable={props.content_editable}
4442
onClick={props.onClick}
4543
onDoubleClick={props.onDoubleClick}
4644
/>
4745
);
48-
};
49-
50-
Markdown.defaultProps = { safeHTML: true, highlight_code: true };
46+
}

0 commit comments

Comments
 (0)