code style
This commit is contained in:
@@ -5,20 +5,18 @@ export interface NodeViewContentProps {
|
|||||||
as?: React.ElementType,
|
as?: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NodeViewContent: React.FC<NodeViewContentProps> =
|
export const NodeViewContent: React.FC<NodeViewContentProps> = React.forwardRef((props, ref) => {
|
||||||
React.forwardRef((props, ref) => {
|
const Tag = props.as || 'div'
|
||||||
const Tag = props.as || 'div'
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tag
|
|
||||||
{...props}
|
|
||||||
ref={ref}
|
|
||||||
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',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|||||||
@@ -6,21 +6,20 @@ export interface NodeViewWrapperProps {
|
|||||||
as?: React.ElementType,
|
as?: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> =
|
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = React.forwardRef((props, ref) => {
|
||||||
React.forwardRef((props, ref) => {
|
const { onDragStart } = useReactNodeView()
|
||||||
const { onDragStart } = useReactNodeView()
|
const Tag = props.as || 'div'
|
||||||
const Tag = props.as || 'div'
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tag
|
<Tag
|
||||||
{...props}
|
{...props}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
data-node-view-wrapper=""
|
data-node-view-wrapper=""
|
||||||
onDragStart={onDragStart}
|
onDragStart={onDragStart}
|
||||||
style={{
|
style={{
|
||||||
...props.style,
|
...props.style,
|
||||||
whiteSpace: 'normal',
|
whiteSpace: 'normal',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user