File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export default class extends Component {
1414 this . handleSource ( props . source , props . newWindow ) ;
1515 }
1616
17+ setRef = ref => this . frameRef = ref ;
18+
1719 handleSource = ( source , newWindow ) => {
1820 if ( ! source . method ) return ;
1921
@@ -90,7 +92,7 @@ export default class extends Component {
9092
9193 postMessage = ( message , origin ) => {
9294 this . frameRef . contentWindow . postMessage ( message , origin ) ;
93- }
95+ } ;
9496
9597 handleInjectedJavaScript = html => {
9698 if ( this . props . injectedJavaScript ) {
@@ -117,7 +119,7 @@ export default class extends Component {
117119 const styleObj = StyleSheet . flatten ( this . props . style ) ;
118120 return createElement ( 'iframe' , {
119121 title,
120- ref : frameRef => { this . frameRef = frameRef ; } ,
122+ ref : this . setRef ,
121123 src : ! source . method ? source . uri : undefined ,
122124 srcDoc : this . handleInjectedJavaScript ( this . state . html || source . html ) ,
123125 width : styleObj && styleObj . width ,
You can’t perform that action at this time.
0 commit comments