Add element properties to markdown-to-jsx (#40542)

This commit is contained in:
Nicholas Boll
2019-11-26 17:11:50 -07:00
committed by Andrew Casey
parent 2703151cbb
commit c2d5a45930
2 changed files with 7 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ import * as React from 'react';
export default class Markdown extends React.Component<MarkdownProps> { }
export interface MarkdownProps {
export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
options?: MarkdownOptions;
// React.ReactNode contains both null and undefined
// tslint:disable-next-line:no-null-undefined-union

View File

@@ -63,3 +63,9 @@ render(
);
<Markdown options={{ slugify: str => str }}># </Markdown>;
// supports passing extra properties to the underlying element
<Markdown className="markdown-body">{`
# Header 1
## Header 2
`}</Markdown>;