article update
This commit is contained in:
1 parent
bf007b583c
commit
830a193333
5 files changed
+42
-35
No files matched your search
@@ -1,7 +1,16 @@
|
||||
import { createElement } from 'react'
|
||||
|
||||
export type HtmlProps = {
|
||||
className?: string
|
||||
as?: keyof HTMLElementTagNameMap
|
||||
html: string
|
||||
}
|
||||
|
||||
export const Html: React.FC<HtmlProps> = props => (
|
||||
<div dangerouslySetInnerHTML={{ __html: props.html }} />
|
||||
)
|
||||
export const Html: React.FC<HtmlProps> = ({ as = 'div', ...props }) => {
|
||||
return createElement(as, {
|
||||
className: props.className,
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: props.html,
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user