55 NativeModules
66} = React ;
77
8+ var AQWebView = requireNativeComponent ( 'AQWebView' , WKWebView ) ;
9+
810class WKWebView extends React . Component {
911
1012 goBack ( ) {
11- NativeModules . AQWebViewManager . goBack ( React . findNodeHandle ( this . refs . AQWebView ) ;
13+ NativeModules . AQWebViewManager . goBack ( React . findNodeHandle ( this . refs . AQWebView ) ) ;
1214 }
1315
1416 goForward ( ) {
15- NativeModules . AQWebViewManager . goForward ( React . findNodeHandle ( this . refs . AQWebView ) ;
17+ NativeModules . AQWebViewManager . goForward ( React . findNodeHandle ( this . refs . AQWebView ) ) ;
1618 }
1719
1820 _onLoadingStart ( navState ) {
@@ -26,20 +28,20 @@ class WKWebView extends React.Component {
2628 this . props . onNavigationStateChange ( { type : 'end' , ...navState . nativeEvent } ) ;
2729 }
2830 }
29-
31+
3032 _onLoadingError ( navState ) {
3133 if ( this . props . onNavigationStateChange ) {
3234 this . props . onNavigationStateChange ( { type : 'error' , ...navState . nativeEvent } ) ;
3335 }
3436 }
3537
3638 render ( ) {
37- return < AQWebView ref = "AQWebView"
38- { ...this . props }
39+ return < AQWebView ref = "AQWebView"
40+ { ...this . props }
3941 onLoadingStart = { this . _onLoadingStart . bind ( this ) }
40- onLoadingEnd = { this . _onLoadingEnd . bind ( this ) }
41- onLoadingError = { this . _onLoadingError . bind ( this ) }
42- /> ;
42+ onLoadingFinish = { this . _onLoadingEnd . bind ( this ) }
43+ onLoadingError = { this . _onLoadingError . bind ( this ) }
44+ /> ;
4345 }
4446
4547}
@@ -50,28 +52,23 @@ WKWebView.propTypes = {
5052 uri : PropTypes . string ,
5153 method : PropTypes . string ,
5254 headers : PropTypes . object ,
53- body : PropTypes . string ,
55+ body : PropTypes . string
5456 } ) ,
5557 PropTypes . shape ( {
5658 html : PropTypes . string ,
57- baseUrl : PropTypes . string ,
58- } ) ,
59+ baseUrl : PropTypes . string
60+ } )
5961 ] ) ,
60-
6162 onNavigationStateChange : PropTypes . func ,
62-
6363 automaticallyAdjustContentInsets : PropTypes . bool ,
6464 contentInset : PropTypes . shape ( {
6565 top : PropTypes . number ,
6666 left : PropTypes . number ,
6767 bottom : PropTypes . number ,
6868 right : PropTypes . number
6969 } ) ,
70-
7170 blockedPrefixes : PropTypes . arrayOf ( PropTypes . string ) ,
72- onPrefixBlocked : PropTypes . func ,
71+ onPrefixBlocked : PropTypes . func
7372} ;
7473
75- var AQWebView = requireNativeComponent ( 'AQWebView' , WKWebView ) ;
76-
7774module . exports = WKWebView ;
0 commit comments