Created
February 16, 2020 16:38
-
-
Save gustav1105/ae0688ad9de7648236dfbd08543c97fd to your computer and use it in GitHub Desktop.
render-block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const renderBlock = (contentBlock: ContentBlock) => { | |
if (contentBlock.getType() === "atomic") { | |
const entityKey = contentBlock.getEntityAt(0); | |
const entityData = editorState | |
.getCurrentContent() | |
.getEntity(entityKey) | |
.getData(); | |
return { | |
component: MediaComponent, | |
editable: false, | |
props: { | |
src: { file: entityData.src } | |
} | |
}; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment