Skip to content

Instantly share code, notes, and snippets.

@bensampaio
Last active January 7, 2020 12:23
Show Gist options
  • Save bensampaio/1b0a844eb91a58c92a73b5683c6f58a7 to your computer and use it in GitHub Desktop.
Save bensampaio/1b0a844eb91a58c92a73b5683c6f58a7 to your computer and use it in GitHub Desktop.
Example of an iframe component method that sets an iframe title as the current page title
class IFrame extends PureComponent {
// ...
setTitle(iframeElement) {
const { contentDocument } = iframeElement;
document.title = contentDocument.title;
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment