mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 18:09:49 +02:00
fix block warning for void nodes
This commit is contained in:
@@ -878,6 +878,7 @@ class Content extends React.Component {
|
||||
return (
|
||||
<Node
|
||||
key={node.key}
|
||||
block={null}
|
||||
node={node}
|
||||
parent={state.document}
|
||||
schema={schema}
|
||||
|
@@ -226,16 +226,17 @@ class Node extends React.Component {
|
||||
*/
|
||||
|
||||
renderNode = (child) => {
|
||||
const { block, editor, node, readOnly, schema, state } = this.props
|
||||
return (
|
||||
<Node
|
||||
key={child.key}
|
||||
node={child}
|
||||
block={this.props.node.kind == 'block' ? this.props.node : this.props.block}
|
||||
parent={this.props.node}
|
||||
editor={this.props.editor}
|
||||
readOnly={this.props.readOnly}
|
||||
schema={this.props.schema}
|
||||
state={this.props.state}
|
||||
block={node.kind == 'block' ? node : block}
|
||||
parent={node}
|
||||
editor={editor}
|
||||
readOnly={readOnly}
|
||||
schema={schema}
|
||||
state={state}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ class Void extends React.Component {
|
||||
*/
|
||||
|
||||
static propTypes = {
|
||||
block: React.PropTypes.object,
|
||||
children: React.PropTypes.any.isRequired,
|
||||
editor: React.PropTypes.object.isRequired,
|
||||
node: React.PropTypes.object.isRequired,
|
||||
@@ -167,7 +168,7 @@ class Void extends React.Component {
|
||||
return (
|
||||
<Leaf
|
||||
key={offsetKey}
|
||||
block={block}
|
||||
block={node.kind == 'block' ? node : block}
|
||||
editor={editor}
|
||||
index={index}
|
||||
marks={marks}
|
||||
|
Reference in New Issue
Block a user