mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 10:51:44 +02:00
got void components working
This commit is contained in:
@@ -152,9 +152,11 @@ class Images extends React.Component {
|
||||
switch (node.type) {
|
||||
case 'image': {
|
||||
return (props) => {
|
||||
const { data } = props.node
|
||||
const { node, state } = props
|
||||
const { data } = node
|
||||
const isActive = state.blocks.includes(node)
|
||||
const src = data.get('src')
|
||||
return <img src={src} />
|
||||
return <img src={src} data-active={isActive} />
|
||||
}
|
||||
}
|
||||
case 'paragraph': {
|
||||
|
@@ -18,6 +18,7 @@
|
||||
"kind": "block",
|
||||
"type": "image",
|
||||
"data": {
|
||||
"isVoid": true,
|
||||
"src": "https://img.washingtonpost.com/wp-apps/imrs.php?src=https://img.washingtonpost.com/news/speaking-of-science/wp-content/uploads/sites/36/2015/10/as12-49-7278-1024x1024.jpg&w=1484"
|
||||
},
|
||||
"nodes": [
|
||||
|
Reference in New Issue
Block a user