Skip to content

Instantly share code, notes, and snippets.

@kohheepeace
Created December 22, 2018 22:57
Show Gist options
  • Save kohheepeace/6fa9ce90a323cccff800f2ce06858631 to your computer and use it in GitHub Desktop.
Save kohheepeace/6fa9ce90a323cccff800f2ce06858631 to your computer and use it in GitHub Desktop.
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