mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
NodeViewContent forwardRef
This commit is contained in:
parent
83525ec4f1
commit
deb79ea729
@ -5,17 +5,20 @@ export interface NodeViewContentProps {
|
||||
as?: React.ElementType,
|
||||
}
|
||||
|
||||
export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
||||
const Tag = props.as || 'div'
|
||||
export const NodeViewContent: React.FC<NodeViewContentProps> =
|
||||
React.forwardRef((props, ref) => {
|
||||
const Tag = props.as || 'div'
|
||||
|
||||
return (
|
||||
<Tag
|
||||
{...props}
|
||||
data-node-view-content=""
|
||||
style={{
|
||||
...props.style,
|
||||
whiteSpace: 'pre-wrap',
|
||||
}}
|
||||
/>
|
||||
)
|
||||
return (
|
||||
<Tag
|
||||
{...props}
|
||||
ref={ref}
|
||||
data-node-view-content=""
|
||||
style={{
|
||||
...props.style,
|
||||
whiteSpace: 'pre-wrap',
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user