code style

This commit is contained in:
Philipp Kühn
2021-06-14 16:04:03 +02:00
parent 55203d38eb
commit 836c87fa69
2 changed files with 30 additions and 33 deletions

View File

@@ -5,20 +5,18 @@ export interface NodeViewContentProps {
as?: React.ElementType,
}
export const NodeViewContent: React.FC<NodeViewContentProps> =
React.forwardRef((props, ref) => {
const Tag = props.as || 'div'
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',
}}
/>
)
})
return (
<Tag
{...props}
ref={ref}
data-node-view-content=""
style={{
...props.style,
whiteSpace: 'pre-wrap',
}}
/>
)
})

View File

@@ -6,21 +6,20 @@ export interface NodeViewWrapperProps {
as?: React.ElementType,
}
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> =
React.forwardRef((props, ref) => {
const { onDragStart } = useReactNodeView()
const Tag = props.as || 'div'
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={{
...props.style,
whiteSpace: 'normal',
}}
/>
)
})
return (
<Tag
{...props}
ref={ref}
data-node-view-wrapper=""
onDragStart={onDragStart}
style={{
...props.style,
whiteSpace: 'normal',
}}
/>
)
})