File tree 2 files changed +16
-11
lines changed
2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 5
5
var React = require ( 'react-native' ) ;
6
6
var {
7
7
View,
8
- PropTypes
8
+ PropTypes,
9
+ requireNativeComponent
9
10
} = React ;
10
11
11
12
var safeHtml = require ( 'safe-html' ) ;
12
13
var _ = require ( 'underscore' ) ;
13
14
14
- var createReactIOSNativeComponentClass = require ( 'createReactIOSNativeComponentClass' ) ;
15
-
16
- var _HTMLWebView = createReactIOSNativeComponentClass ( {
17
- validAttributes : { html : true , enableScroll : true } ,
18
- uiViewClassName : 'AIBHTMLWebView'
19
- } )
20
15
16
+ var _HTMLWebView = React . createClass ( {
17
+ propTypes : {
18
+ html : PropTypes . string ,
19
+ enableScroll : PropTypes . bool
20
+ } ,
21
+ render : function ( ) {
22
+ return < NativeHTMLWebView { ...this . props } /> ;
23
+ }
24
+ } ) ;
25
+ var NativeHTMLWebView = requireNativeComponent ( 'AIBHTMLWebView' , _HTMLWebView ) ;
21
26
22
27
var HTMLWebView = React . createClass ( {
23
28
propTypes : {
@@ -30,8 +35,6 @@ var HTMLWebView = React.createClass({
30
35
autoHeight : PropTypes . bool
31
36
} ,
32
37
33
-
34
-
35
38
shouldComponentUpdate : function ( nextProps , nextState ) {
36
39
return ! _ . isEqual ( nextProps , this . props ) || ! _ . isEqual ( nextState , this . state ) ;
37
40
} ,
@@ -91,6 +94,8 @@ var HTMLWebView = React.createClass({
91
94
}
92
95
} ) ;
93
96
97
+
98
+
94
99
module . exports = HTMLWebView ;
95
100
96
101
// Allow a few more things than the default config for safe-html since
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-html-webview" ,
3
- "version" : " 0.0.8 " ,
3
+ "version" : " 0.0.9 " ,
4
4
"description" : " Display (possibly untrusted) HTML using a UIWebView in React Native." ,
5
5
"main" : " index.ios.js" ,
6
6
"scripts" : {
25
25
},
26
26
"homepage" : " https://github.com/almost/react-native-html-webview" ,
27
27
"peerDepenencies" : {
28
- "react-native" : " ^0.4.1 "
28
+ "react-native" : " ^0.4.4 "
29
29
},
30
30
"dependencies" : {
31
31
"safe-html" : " 0.0.2"
You can’t perform that action at this time.
0 commit comments