1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-01 04:50:27 +02:00

loosen default shouldComponentUpdate for nodes, and make Void implicit

This commit is contained in:
Ian Storm Taylor
2016-08-04 14:12:27 -07:00
parent 18acc638fd
commit 9a70188f34
9 changed files with 104 additions and 67 deletions

View File

@@ -15,11 +15,11 @@ import isUrl from 'is-url'
const NODES = {
image: (props) => {
const { node, state } = props
const isFocused = state.selection.hasEdgeIn(node)
const src = node.data.get('src')
const className = isFocused ? 'active' : null
return (
<Void {...props} className="image-block">
<img src={src} {...props.attributes} />
</Void>
<img src={src} className={className} {...props.attributes} />
)
}
}