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