Last active
January 7, 2020 12:23
-
-
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
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
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