mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-02 07:47:49 +08:00
23 lines
428 B
TypeScript
23 lines
428 B
TypeScript
import React from 'react'
|
|
|
|
export interface NodeViewContentProps {
|
|
[key: string]: any,
|
|
as?: React.ElementType,
|
|
}
|
|
|
|
export const NodeViewContent: React.FC<NodeViewContentProps> = React.forwardRef((props, ref) => {
|
|
const Tag = props.as || 'div'
|
|
|
|
return (
|
|
<Tag
|
|
{...props}
|
|
ref={ref}
|
|
data-node-view-content=""
|
|
style={{
|
|
...props.style,
|
|
whiteSpace: 'pre-wrap',
|
|
}}
|
|
/>
|
|
)
|
|
})
|