Files
tiptap/packages/react/src/NodeViewContent.tsx
Dominik 8c6751f0c6 add precommit hook for linting and automatic eslint fixes + update eslint packages (#2862)
* chore: add precommit hook for eslint fixes, fix linting issues
* chore: add eslint import sort plugin
2022-06-08 14:10:25 +02:00

26 lines
525 B
TypeScript

import React from 'react'
import { useReactNodeView } from './useReactNodeView'
export interface NodeViewContentProps {
[key: string]: any,
as?: React.ElementType,
}
export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
const Tag = props.as || 'div'
const { nodeViewContentRef } = useReactNodeView()
return (
<Tag
{...props}
ref={nodeViewContentRef}
data-node-view-content=""
style={{
...props.style,
whiteSpace: 'pre-wrap',
}}
/>
)
}