Skip to content

Commit bc1962b

Browse files
committed
Use createElement
1 parent 82fbd58 commit bc1962b

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

src/index.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Qs from 'qs';
22
import React, { Component } from 'react';
3-
import { StyleSheet, View, ActivityIndicator } from 'react-native';
3+
import { StyleSheet, View, ActivityIndicator, createElement } from 'react-native';
44

55
export default class extends Component {
66
static defaultProps = {
@@ -98,24 +98,17 @@ export default class extends Component {
9898
}
9999

100100
const { title, source, onLoad, scrollEnabled } = this.props;
101-
return (
102-
<iframe
103-
title={title}
104-
src={!source.method ? source.uri : undefined}
105-
srcDoc={this.state.html || source.html}
106-
style={{
107-
width: '100%',
108-
height: '100%',
109-
border: 0,
110-
overflow: !scrollEnabled ? 'hidden' : undefined,
111-
}}
112-
allowFullScreen
113-
allowpaymentrequest="true"
114-
frameBorder="0"
115-
seamless
116-
onLoad={onLoad}
117-
/>
118-
);
101+
return createElement('iframe', {
102+
title,
103+
src: !source.method ? source.uri : undefined,
104+
srcDoc: this.state.html || source.html,
105+
style: [styles.iframe, scrollEnabled && styles.noScroll],
106+
allowFullScreen: true,
107+
allowpaymentrequest: 'true',
108+
frameBorder: '0',
109+
seamless: true,
110+
onLoad,
111+
});
119112
}
120113
}
121114

0 commit comments

Comments
 (0)