add dynamic tags
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
import React from 'react'
|
||||
import { useReactNodeView } from './useReactNodeView'
|
||||
|
||||
export const NodeViewContent: React.FC = props => {
|
||||
export interface NodeViewContentProps {
|
||||
as: React.ElementType
|
||||
}
|
||||
|
||||
export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
||||
// TODO
|
||||
// @ts-ignore
|
||||
const { isEditable } = useReactNodeView()
|
||||
|
||||
const Tag = props.as || 'div'
|
||||
|
||||
return (
|
||||
<div
|
||||
<Tag
|
||||
data-node-view-content=""
|
||||
contentEditable={isEditable}
|
||||
style={{
|
||||
@@ -15,5 +21,4 @@ export const NodeViewContent: React.FC = props => {
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user