You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
558 B

import React from 'react'
import { useReactNodeView } from './useReactNodeView'
export interface NodeViewWrapperProps {
[key: string]: any,
as?: React.ElementType,
}
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = React.forwardRef((props, ref) => {
const { onDragStart } = useReactNodeView()
const Tag = props.as || 'div'
return (
<Tag
{...props}
ref={ref}
data-node-view-wrapper=""
onDragStart={onDragStart}
style={{
whiteSpace: 'normal',
...props.style,
}}
/>
)
})