Created
December 22, 2018 22:57
-
-
Save kohheepeace/6fa9ce90a323cccff800f2ce06858631 to your computer and use it in GitHub Desktop.
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
import React from 'react' | |
import { blue } from '@material-ui/core/colors' | |
export default class Iframe extends React.PureComponent { | |
componentDidMount () { | |
window.iframely && window.iframely.load() | |
} | |
getIframelyHtml = () => { | |
const { node } = this.props | |
const iframelyHtml = node.data.get('iframelyHtml') | |
return {__html: iframelyHtml} | |
} | |
render () { | |
const { | |
attributes | |
} = this.props | |
return ( | |
<div dangerouslySetInnerHTML={this.getIframelyHtml()} {...attributes} /> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment