add classname support for react components
This commit is contained in:
@@ -2,7 +2,8 @@ import React from 'react'
|
|||||||
import { useReactNodeView } from './useReactNodeView'
|
import { useReactNodeView } from './useReactNodeView'
|
||||||
|
|
||||||
export interface NodeViewContentProps {
|
export interface NodeViewContentProps {
|
||||||
as: React.ElementType
|
className?: string,
|
||||||
|
as: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
||||||
@@ -11,6 +12,7 @@ export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tag
|
<Tag
|
||||||
|
className={props.className}
|
||||||
data-node-view-content=""
|
data-node-view-content=""
|
||||||
contentEditable={isEditable}
|
contentEditable={isEditable}
|
||||||
style={{ whiteSpace: 'pre-wrap' }}
|
style={{ whiteSpace: 'pre-wrap' }}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import React from 'react'
|
|||||||
import { useReactNodeView } from './useReactNodeView'
|
import { useReactNodeView } from './useReactNodeView'
|
||||||
|
|
||||||
export interface NodeViewWrapperProps {
|
export interface NodeViewWrapperProps {
|
||||||
as: React.ElementType
|
className?: string,
|
||||||
|
as: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = props => {
|
export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = props => {
|
||||||
@@ -11,6 +12,7 @@ export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = props => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tag
|
<Tag
|
||||||
|
className={props.className}
|
||||||
data-node-view-wrapper=""
|
data-node-view-wrapper=""
|
||||||
onDragStart={onDragStart}
|
onDragStart={onDragStart}
|
||||||
style={{ whiteSpace: 'normal' }}
|
style={{ whiteSpace: 'normal' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user