Browse Source

Merge pull request #49 from react-native-community/renaming/rct-rnc

Renaming/rct->rnc to fix ios build
Thibault Malbranche 6 years ago
parent
commit
6c911952c5
No account linked to committer's email address

+ 0
- 5
ios/RCTUIWebViewManager.h View File

1
-#import <React/RCTViewManager.h>
2
-
3
-@interface RCTUIWebViewManager : RCTViewManager
4
-
5
-@end

ios/RCTUIWebView.h → ios/RNCUIWebView.h View File

1
 #import <React/RCTView.h>
1
 #import <React/RCTView.h>
2
 
2
 
3
-@class RCTUIWebView;
3
+@class RNCUIWebView;
4
 
4
 
5
 /**
5
 /**
6
  * Special scheme used to pass messages to the injectedJavaScript
6
  * Special scheme used to pass messages to the injectedJavaScript
10
  */
10
  */
11
 extern NSString *const RNCJSNavigationScheme;
11
 extern NSString *const RNCJSNavigationScheme;
12
 
12
 
13
-@protocol RCTUIWebViewDelegate <NSObject>
13
+@protocol RNCUIWebViewDelegate <NSObject>
14
 
14
 
15
-- (BOOL)webView:(RCTUIWebView *)webView
15
+- (BOOL)webView:(RNCUIWebView *)webView
16
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
16
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
17
    withCallback:(RCTDirectEventBlock)callback;
17
    withCallback:(RCTDirectEventBlock)callback;
18
 
18
 
19
 @end
19
 @end
20
 
20
 
21
-@interface RCTUIWebView : RCTView
21
+@interface RNCUIWebView : RCTView
22
 
22
 
23
-@property (nonatomic, weak) id<RCTUIWebViewDelegate> delegate;
23
+@property (nonatomic, weak) id<RNCUIWebViewDelegate> delegate;
24
 
24
 
25
 @property (nonatomic, copy) NSDictionary *source;
25
 @property (nonatomic, copy) NSDictionary *source;
26
 @property (nonatomic, assign) UIEdgeInsets contentInset;
26
 @property (nonatomic, assign) UIEdgeInsets contentInset;

ios/RCTUIWebView.m → ios/RNCUIWebView.m View File

1
-#import "RCTUIWebView.h"
1
+#import "RNCUIWebView.h"
2
 
2
 
3
 // #import <UIKit/UIKit.h>
3
 // #import <UIKit/UIKit.h>
4
 #import <React/RCTAutoInsetsProtocol.h>
4
 #import <React/RCTAutoInsetsProtocol.h>
13
 
13
 
14
 static NSString *const kPostMessageHost = @"postMessage";
14
 static NSString *const kPostMessageHost = @"postMessage";
15
 
15
 
16
-@interface RCTUIWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
16
+@interface RNCUIWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
17
 
17
 
18
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
18
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
19
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
19
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
23
 
23
 
24
 @end
24
 @end
25
 
25
 
26
-@implementation RCTUIWebView
26
+@implementation RNCUIWebView
27
 {
27
 {
28
   UIWebView *_webView;
28
   UIWebView *_webView;
29
   NSString *_injectedJavaScript;
29
   NSString *_injectedJavaScript;

+ 5
- 0
ios/RNCUIWebViewManager.h View File

1
+#import <React/RCTViewManager.h>
2
+
3
+@interface RNCUIWebViewManager : RCTViewManager
4
+
5
+@end

ios/RCTUIWebViewManager.m → ios/RNCUIWebViewManager.m View File

1
-#import "RCTUIWebViewManager.h"
1
+#import "RNCUIWebViewManager.h"
2
 
2
 
3
 #import <React/RCTBridge.h>
3
 #import <React/RCTBridge.h>
4
 #import <React/RCTUIManager.h>
4
 #import <React/RCTUIManager.h>
5
 #import <React/UIView+React.h>
5
 #import <React/UIView+React.h>
6
-#import "RCTUIWebView.h"
6
+#import "RNCUIWebView.h"
7
 
7
 
8
-@interface RCTUIWebViewManager () <RCTUIWebViewDelegate>
8
+@interface RNCUIWebViewManager () <RNCUIWebViewDelegate>
9
 
9
 
10
 @end
10
 @end
11
 
11
 
12
-@implementation RCTUIWebViewManager
12
+@implementation RNCUIWebViewManager
13
 {
13
 {
14
   NSConditionLock *_shouldStartLoadLock;
14
   NSConditionLock *_shouldStartLoadLock;
15
   BOOL _shouldStartLoad;
15
   BOOL _shouldStartLoad;
19
 
19
 
20
 - (UIView *)view
20
 - (UIView *)view
21
 {
21
 {
22
-  RCTUIWebView *webView = [RCTUIWebView new];
22
+  RNCUIWebView *webView = [RNCUIWebView new];
23
   webView.delegate = self;
23
   webView.delegate = self;
24
   return webView;
24
   return webView;
25
 }
25
 }
44
 
44
 
45
 RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
45
 RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
46
 {
46
 {
47
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTUIWebView *> *viewRegistry) {
48
-    RCTUIWebView *view = viewRegistry[reactTag];
49
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
50
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
47
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCUIWebView *> *viewRegistry) {
48
+    RNCUIWebView *view = viewRegistry[reactTag];
49
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
50
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
51
     } else {
51
     } else {
52
       [view goBack];
52
       [view goBack];
53
     }
53
     }
57
 RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
57
 RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
58
 {
58
 {
59
   [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
59
   [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
60
-    RCTUIWebView *view = viewRegistry[reactTag];
61
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
62
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
60
+    RNCUIWebView *view = viewRegistry[reactTag];
61
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
62
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
63
     } else {
63
     } else {
64
       [view goForward];
64
       [view goForward];
65
     }
65
     }
68
 
68
 
69
 RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
69
 RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
70
 {
70
 {
71
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTUIWebView *> *viewRegistry) {
72
-    RCTUIWebView *view = viewRegistry[reactTag];
73
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
74
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
71
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCUIWebView *> *viewRegistry) {
72
+    RNCUIWebView *view = viewRegistry[reactTag];
73
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
74
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
75
     } else {
75
     } else {
76
       [view reload];
76
       [view reload];
77
     }
77
     }
80
 
80
 
81
 RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
81
 RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
82
 {
82
 {
83
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTUIWebView *> *viewRegistry) {
84
-    RCTUIWebView *view = viewRegistry[reactTag];
85
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
86
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
83
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCUIWebView *> *viewRegistry) {
84
+    RNCUIWebView *view = viewRegistry[reactTag];
85
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
86
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
87
     } else {
87
     } else {
88
       [view stopLoading];
88
       [view stopLoading];
89
     }
89
     }
92
 
92
 
93
 RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
93
 RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
94
 {
94
 {
95
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTUIWebView *> *viewRegistry) {
96
-    RCTUIWebView *view = viewRegistry[reactTag];
97
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
98
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
95
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCUIWebView *> *viewRegistry) {
96
+    RNCUIWebView *view = viewRegistry[reactTag];
97
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
98
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
99
     } else {
99
     } else {
100
       [view postMessage:message];
100
       [view postMessage:message];
101
     }
101
     }
104
 
104
 
105
 RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)
105
 RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)
106
 {
106
 {
107
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTUIWebView *> *viewRegistry) {
108
-    RCTUIWebView *view = viewRegistry[reactTag];
109
-    if (![view isKindOfClass:[RCTUIWebView class]]) {
110
-      RCTLogError(@"Invalid view returned from registry, expecting RCTUIWebView, got: %@", view);
107
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCUIWebView *> *viewRegistry) {
108
+    RNCUIWebView *view = viewRegistry[reactTag];
109
+    if (![view isKindOfClass:[RNCUIWebView class]]) {
110
+      RCTLogError(@"Invalid view returned from registry, expecting RNCUIWebView, got: %@", view);
111
     } else {
111
     } else {
112
       [view injectJavaScript:script];
112
       [view injectJavaScript:script];
113
     }
113
     }
116
 
116
 
117
 #pragma mark - Exported synchronous methods
117
 #pragma mark - Exported synchronous methods
118
 
118
 
119
-- (BOOL)webView:(__unused RCTUIWebView *)webView
119
+- (BOOL)webView:(__unused RNCUIWebView *)webView
120
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
120
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
121
    withCallback:(RCTDirectEventBlock)callback
121
    withCallback:(RCTDirectEventBlock)callback
122
 {
122
 {

ios/RCTWKWebView.h → ios/RNCWKWebView.h View File

9
 #import <React/RCTDefines.h>
9
 #import <React/RCTDefines.h>
10
 #import <WebKit/WebKit.h>
10
 #import <WebKit/WebKit.h>
11
 
11
 
12
-@class RCTWKWebView;
12
+@class RNCWKWebView;
13
 
13
 
14
-@protocol RCTWKWebViewDelegate <NSObject>
14
+@protocol RNCWKWebViewDelegate <NSObject>
15
 
15
 
16
-- (BOOL)webView:(RCTWKWebView *)webView
16
+- (BOOL)webView:(RNCWKWebView *)webView
17
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
17
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
18
    withCallback:(RCTDirectEventBlock)callback;
18
    withCallback:(RCTDirectEventBlock)callback;
19
 
19
 
20
 @end
20
 @end
21
 
21
 
22
-@interface RCTWKWebView : RCTView
22
+@interface RNCWKWebView : RCTView
23
 
23
 
24
-@property (nonatomic, weak) id<RCTWKWebViewDelegate> delegate;
24
+@property (nonatomic, weak) id<RNCWKWebViewDelegate> delegate;
25
 @property (nonatomic, copy) NSDictionary *source;
25
 @property (nonatomic, copy) NSDictionary *source;
26
 @property (nonatomic, assign) BOOL messagingEnabled;
26
 @property (nonatomic, assign) BOOL messagingEnabled;
27
 @property (nonatomic, copy) NSString *injectedJavaScript;
27
 @property (nonatomic, copy) NSString *injectedJavaScript;

ios/RCTWKWebView.m → ios/RNCWKWebView.m View File

5
  * LICENSE file in the root directory of this source tree.
5
  * LICENSE file in the root directory of this source tree.
6
  */
6
  */
7
 
7
 
8
-#import "RCTWKWebView.h"
8
+#import "RNCWKWebView.h"
9
 #import <React/RCTConvert.h>
9
 #import <React/RCTConvert.h>
10
 #import <React/RCTAutoInsetsProtocol.h>
10
 #import <React/RCTAutoInsetsProtocol.h>
11
 
11
 
12
 static NSString *const MessageHanderName = @"ReactNative";
12
 static NSString *const MessageHanderName = @"ReactNative";
13
 
13
 
14
-@interface RCTWKWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler, UIScrollViewDelegate, RCTAutoInsetsProtocol>
14
+@interface RNCWKWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler, UIScrollViewDelegate, RCTAutoInsetsProtocol>
15
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
15
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
16
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
16
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
17
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
17
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
20
 @property (nonatomic, copy) WKWebView *webView;
20
 @property (nonatomic, copy) WKWebView *webView;
21
 @end
21
 @end
22
 
22
 
23
-@implementation RCTWKWebView
23
+@implementation RNCWKWebView
24
 {
24
 {
25
   UIColor * _savedBackgroundColor;
25
   UIColor * _savedBackgroundColor;
26
 }
26
 }
206
 {
206
 {
207
   [super layoutSubviews];
207
   [super layoutSubviews];
208
 
208
 
209
-  // Ensure webview takes the position and dimensions of RCTWKWebView
209
+  // Ensure webview takes the position and dimensions of RNCWKWebView
210
   _webView.frame = self.bounds;
210
   _webView.frame = self.bounds;
211
 }
211
 }
212
 
212
 

ios/RCTWKWebViewManager.h → ios/RNCWKWebViewManager.h View File

7
 
7
 
8
 #import <React/RCTViewManager.h>
8
 #import <React/RCTViewManager.h>
9
 
9
 
10
-@interface RCTWKWebViewManager : RCTViewManager
10
+@interface RNCWKWebViewManager : RCTViewManager
11
 @end
11
 @end

ios/RCTWKWebViewManager.m → ios/RNCWKWebViewManager.m View File

5
  * LICENSE file in the root directory of this source tree.
5
  * LICENSE file in the root directory of this source tree.
6
  */
6
  */
7
 
7
 
8
-#import "RCTWKWebViewManager.h"
8
+#import "RNCWKWebViewManager.h"
9
 
9
 
10
 #import <React/RCTUIManager.h>
10
 #import <React/RCTUIManager.h>
11
 #import <React/RCTDefines.h>
11
 #import <React/RCTDefines.h>
12
-#import "RCTWKWebView.h"
12
+#import "RNCWKWebView.h"
13
 
13
 
14
-@interface RCTWKWebViewManager () <RCTWKWebViewDelegate>
14
+@interface RNCWKWebViewManager () <RNCWKWebViewDelegate>
15
 @end
15
 @end
16
 
16
 
17
-@implementation RCTWKWebViewManager
17
+@implementation RNCWKWebViewManager
18
 {
18
 {
19
   NSConditionLock *_shouldStartLoadLock;
19
   NSConditionLock *_shouldStartLoadLock;
20
   BOOL _shouldStartLoad;
20
   BOOL _shouldStartLoad;
24
 
24
 
25
 - (UIView *)view
25
 - (UIView *)view
26
 {
26
 {
27
-  RCTWKWebView *webView = [RCTWKWebView new];
27
+  RNCWKWebView *webView = [RNCWKWebView new];
28
   webView.delegate = self;
28
   webView.delegate = self;
29
   return webView;
29
   return webView;
30
 }
30
 }
51
 
51
 
52
 RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
52
 RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
53
 {
53
 {
54
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
55
-    RCTWKWebView *view = viewRegistry[reactTag];
56
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
57
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
54
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
55
+    RNCWKWebView *view = viewRegistry[reactTag];
56
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
57
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
58
     } else {
58
     } else {
59
       [view postMessage:message];
59
       [view postMessage:message];
60
     }
60
     }
61
   }];
61
   }];
62
 }
62
 }
63
 
63
 
64
-RCT_CUSTOM_VIEW_PROPERTY(bounces, BOOL, RCTWKWebView) {
64
+RCT_CUSTOM_VIEW_PROPERTY(bounces, BOOL, RNCWKWebView) {
65
   view.bounces = json == nil ? true : [RCTConvert BOOL: json];
65
   view.bounces = json == nil ? true : [RCTConvert BOOL: json];
66
 }
66
 }
67
 
67
 
68
-RCT_CUSTOM_VIEW_PROPERTY(scrollEnabled, BOOL, RCTWKWebView) {
68
+RCT_CUSTOM_VIEW_PROPERTY(scrollEnabled, BOOL, RNCWKWebView) {
69
   view.scrollEnabled = json == nil ? true : [RCTConvert BOOL: json];
69
   view.scrollEnabled = json == nil ? true : [RCTConvert BOOL: json];
70
 }
70
 }
71
 
71
 
72
-RCT_CUSTOM_VIEW_PROPERTY(decelerationRate, CGFloat, RCTWKWebView) {
72
+RCT_CUSTOM_VIEW_PROPERTY(decelerationRate, CGFloat, RNCWKWebView) {
73
   view.decelerationRate = json == nil ? UIScrollViewDecelerationRateNormal : [RCTConvert CGFloat: json];
73
   view.decelerationRate = json == nil ? UIScrollViewDecelerationRateNormal : [RCTConvert CGFloat: json];
74
 }
74
 }
75
 
75
 
76
 RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)
76
 RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)
77
 {
77
 {
78
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
79
-    RCTWKWebView *view = viewRegistry[reactTag];
80
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
81
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
78
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
79
+    RNCWKWebView *view = viewRegistry[reactTag];
80
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
81
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
82
     } else {
82
     } else {
83
       [view injectJavaScript:script];
83
       [view injectJavaScript:script];
84
     }
84
     }
87
 
87
 
88
 RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
88
 RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
89
 {
89
 {
90
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
91
-    RCTWKWebView *view = viewRegistry[reactTag];
92
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
93
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
90
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
91
+    RNCWKWebView *view = viewRegistry[reactTag];
92
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
93
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
94
     } else {
94
     } else {
95
       [view goBack];
95
       [view goBack];
96
     }
96
     }
99
 
99
 
100
 RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
100
 RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
101
 {
101
 {
102
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
103
-    RCTWKWebView *view = viewRegistry[reactTag];
104
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
105
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
102
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
103
+    RNCWKWebView *view = viewRegistry[reactTag];
104
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
105
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
106
     } else {
106
     } else {
107
       [view goForward];
107
       [view goForward];
108
     }
108
     }
111
 
111
 
112
 RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
112
 RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
113
 {
113
 {
114
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
115
-    RCTWKWebView *view = viewRegistry[reactTag];
116
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
117
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
114
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
115
+    RNCWKWebView *view = viewRegistry[reactTag];
116
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
117
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
118
     } else {
118
     } else {
119
       [view reload];
119
       [view reload];
120
     }
120
     }
123
 
123
 
124
 RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
124
 RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
125
 {
125
 {
126
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWKWebView *> *viewRegistry) {
127
-    RCTWKWebView *view = viewRegistry[reactTag];
128
-    if (![view isKindOfClass:[RCTWKWebView class]]) {
129
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
126
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWKWebView *> *viewRegistry) {
127
+    RNCWKWebView *view = viewRegistry[reactTag];
128
+    if (![view isKindOfClass:[RNCWKWebView class]]) {
129
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWKWebView, got: %@", view);
130
     } else {
130
     } else {
131
       [view stopLoading];
131
       [view stopLoading];
132
     }
132
     }
135
 
135
 
136
 #pragma mark - Exported synchronous methods
136
 #pragma mark - Exported synchronous methods
137
 
137
 
138
-- (BOOL)          webView:(RCTWKWebView *)webView
138
+- (BOOL)          webView:(RNCWKWebView *)webView
139
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
139
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
140
              withCallback:(RCTDirectEventBlock)callback
140
              withCallback:(RCTDirectEventBlock)callback
141
 {
141
 {

ios/RCTWebView.xcodeproj/project.pbxproj → ios/RNCWebView.xcodeproj/project.pbxproj View File

7
 	objects = {
7
 	objects = {
8
 
8
 
9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
10
-		E914DBF6214474710071092B /* RCTUIWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E914DBF3214474710071092B /* RCTUIWebViewManager.m */; };
11
-		E914DBF7214474710071092B /* RCTUIWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E914DBF4214474710071092B /* RCTUIWebView.m */; };
12
-		E91B351D21446E6C00F9801F /* RCTWKWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */; };
13
-		E91B351E21446E6C00F9801F /* RCTWKWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RCTWKWebView.m */; };
10
+		E914DBF6214474710071092B /* RNCUIWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E914DBF3214474710071092B /* RNCUIWebViewManager.m */; };
11
+		E914DBF7214474710071092B /* RNCUIWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E914DBF4214474710071092B /* RNCUIWebView.m */; };
12
+		E91B351D21446E6C00F9801F /* RNCWKWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RNCWKWebViewManager.m */; };
13
+		E91B351E21446E6C00F9801F /* RNCWKWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCWKWebView.m */; };
14
 /* End PBXBuildFile section */
14
 /* End PBXBuildFile section */
15
 
15
 
16
 /* Begin PBXCopyFilesBuildPhase section */
16
 /* Begin PBXCopyFilesBuildPhase section */
26
 /* End PBXCopyFilesBuildPhase section */
26
 /* End PBXCopyFilesBuildPhase section */
27
 
27
 
28
 /* Begin PBXFileReference section */
28
 /* Begin PBXFileReference section */
29
-		134814201AA4EA6300B7C361 /* libRCTWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
-		E914DBF2214474710071092B /* RCTUIWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIWebView.h; sourceTree = "<group>"; };
31
-		E914DBF3214474710071092B /* RCTUIWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIWebViewManager.m; sourceTree = "<group>"; };
32
-		E914DBF4214474710071092B /* RCTUIWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIWebView.m; sourceTree = "<group>"; };
33
-		E914DBF5214474710071092B /* RCTUIWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIWebViewManager.h; sourceTree = "<group>"; };
34
-		E91B351921446E6C00F9801F /* RCTWKWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebViewManager.h; sourceTree = "<group>"; };
35
-		E91B351A21446E6C00F9801F /* RCTWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebView.h; sourceTree = "<group>"; };
36
-		E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebViewManager.m; sourceTree = "<group>"; };
37
-		E91B351C21446E6C00F9801F /* RCTWKWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebView.m; sourceTree = "<group>"; };
29
+		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
+		E914DBF2214474710071092B /* RNCUIWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCUIWebView.h; sourceTree = "<group>"; };
31
+		E914DBF3214474710071092B /* RNCUIWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCUIWebViewManager.m; sourceTree = "<group>"; };
32
+		E914DBF4214474710071092B /* RNCUIWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCUIWebView.m; sourceTree = "<group>"; };
33
+		E914DBF5214474710071092B /* RNCUIWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCUIWebViewManager.h; sourceTree = "<group>"; };
34
+		E91B351921446E6C00F9801F /* RNCWKWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWKWebViewManager.h; sourceTree = "<group>"; };
35
+		E91B351A21446E6C00F9801F /* RNCWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWKWebView.h; sourceTree = "<group>"; };
36
+		E91B351B21446E6C00F9801F /* RNCWKWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWKWebViewManager.m; sourceTree = "<group>"; };
37
+		E91B351C21446E6C00F9801F /* RNCWKWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWKWebView.m; sourceTree = "<group>"; };
38
 /* End PBXFileReference section */
38
 /* End PBXFileReference section */
39
 
39
 
40
 /* Begin PBXFrameworksBuildPhase section */
40
 /* Begin PBXFrameworksBuildPhase section */
51
 		134814211AA4EA7D00B7C361 /* Products */ = {
51
 		134814211AA4EA7D00B7C361 /* Products */ = {
52
 			isa = PBXGroup;
52
 			isa = PBXGroup;
53
 			children = (
53
 			children = (
54
-				134814201AA4EA6300B7C361 /* libRCTWebView.a */,
54
+				134814201AA4EA6300B7C361 /* libRNCWebView.a */,
55
 			);
55
 			);
56
 			name = Products;
56
 			name = Products;
57
 			sourceTree = "<group>";
57
 			sourceTree = "<group>";
59
 		58B511D21A9E6C8500147676 = {
59
 		58B511D21A9E6C8500147676 = {
60
 			isa = PBXGroup;
60
 			isa = PBXGroup;
61
 			children = (
61
 			children = (
62
-				E914DBF2214474710071092B /* RCTUIWebView.h */,
63
-				E914DBF4214474710071092B /* RCTUIWebView.m */,
64
-				E914DBF5214474710071092B /* RCTUIWebViewManager.h */,
65
-				E914DBF3214474710071092B /* RCTUIWebViewManager.m */,
66
-				E91B351A21446E6C00F9801F /* RCTWKWebView.h */,
67
-				E91B351C21446E6C00F9801F /* RCTWKWebView.m */,
68
-				E91B351921446E6C00F9801F /* RCTWKWebViewManager.h */,
69
-				E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */,
62
+				E914DBF2214474710071092B /* RNCUIWebView.h */,
63
+				E914DBF4214474710071092B /* RNCUIWebView.m */,
64
+				E914DBF5214474710071092B /* RNCUIWebViewManager.h */,
65
+				E914DBF3214474710071092B /* RNCUIWebViewManager.m */,
66
+				E91B351A21446E6C00F9801F /* RNCWKWebView.h */,
67
+				E91B351C21446E6C00F9801F /* RNCWKWebView.m */,
68
+				E91B351921446E6C00F9801F /* RNCWKWebViewManager.h */,
69
+				E91B351B21446E6C00F9801F /* RNCWKWebViewManager.m */,
70
 				134814211AA4EA7D00B7C361 /* Products */,
70
 				134814211AA4EA7D00B7C361 /* Products */,
71
 			);
71
 			);
72
 			sourceTree = "<group>";
72
 			sourceTree = "<group>";
74
 /* End PBXGroup section */
74
 /* End PBXGroup section */
75
 
75
 
76
 /* Begin PBXNativeTarget section */
76
 /* Begin PBXNativeTarget section */
77
-		58B511DA1A9E6C8500147676 /* RCTWebView */ = {
77
+		58B511DA1A9E6C8500147676 /* RNCWebView */ = {
78
 			isa = PBXNativeTarget;
78
 			isa = PBXNativeTarget;
79
-			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWebView" */;
79
+			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */;
80
 			buildPhases = (
80
 			buildPhases = (
81
 				58B511D71A9E6C8500147676 /* Sources */,
81
 				58B511D71A9E6C8500147676 /* Sources */,
82
 				58B511D81A9E6C8500147676 /* Frameworks */,
82
 				58B511D81A9E6C8500147676 /* Frameworks */,
86
 			);
86
 			);
87
 			dependencies = (
87
 			dependencies = (
88
 			);
88
 			);
89
-			name = RCTWebView;
89
+			name = RNCWebView;
90
 			productName = RCTDataManager;
90
 			productName = RCTDataManager;
91
-			productReference = 134814201AA4EA6300B7C361 /* libRCTWebView.a */;
91
+			productReference = 134814201AA4EA6300B7C361 /* libRNCWebView.a */;
92
 			productType = "com.apple.product-type.library.static";
92
 			productType = "com.apple.product-type.library.static";
93
 		};
93
 		};
94
 /* End PBXNativeTarget section */
94
 /* End PBXNativeTarget section */
105
 					};
105
 					};
106
 				};
106
 				};
107
 			};
107
 			};
108
-			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWebView" */;
108
+			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */;
109
 			compatibilityVersion = "Xcode 3.2";
109
 			compatibilityVersion = "Xcode 3.2";
110
 			developmentRegion = English;
110
 			developmentRegion = English;
111
 			hasScannedForEncodings = 0;
111
 			hasScannedForEncodings = 0;
117
 			projectDirPath = "";
117
 			projectDirPath = "";
118
 			projectRoot = "";
118
 			projectRoot = "";
119
 			targets = (
119
 			targets = (
120
-				58B511DA1A9E6C8500147676 /* RCTWebView */,
120
+				58B511DA1A9E6C8500147676 /* RNCWebView */,
121
 			);
121
 			);
122
 		};
122
 		};
123
 /* End PBXProject section */
123
 /* End PBXProject section */
127
 			isa = PBXSourcesBuildPhase;
127
 			isa = PBXSourcesBuildPhase;
128
 			buildActionMask = 2147483647;
128
 			buildActionMask = 2147483647;
129
 			files = (
129
 			files = (
130
-				E91B351D21446E6C00F9801F /* RCTWKWebViewManager.m in Sources */,
131
-				E914DBF7214474710071092B /* RCTUIWebView.m in Sources */,
132
-				E914DBF6214474710071092B /* RCTUIWebViewManager.m in Sources */,
133
-				E91B351E21446E6C00F9801F /* RCTWKWebView.m in Sources */,
130
+				E91B351D21446E6C00F9801F /* RNCWKWebViewManager.m in Sources */,
131
+				E914DBF7214474710071092B /* RNCUIWebView.m in Sources */,
132
+				E914DBF6214474710071092B /* RNCUIWebViewManager.m in Sources */,
133
+				E91B351E21446E6C00F9801F /* RNCWKWebView.m in Sources */,
134
 			);
134
 			);
135
 			runOnlyForDeploymentPostprocessing = 0;
135
 			runOnlyForDeploymentPostprocessing = 0;
136
 		};
136
 		};
229
 				);
229
 				);
230
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
230
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
231
 				OTHER_LDFLAGS = "-ObjC";
231
 				OTHER_LDFLAGS = "-ObjC";
232
-				PRODUCT_NAME = RCTWebView;
232
+				PRODUCT_NAME = RNCWebView;
233
 				SKIP_INSTALL = YES;
233
 				SKIP_INSTALL = YES;
234
 			};
234
 			};
235
 			name = Debug;
235
 			name = Debug;
245
 				);
245
 				);
246
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
246
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
247
 				OTHER_LDFLAGS = "-ObjC";
247
 				OTHER_LDFLAGS = "-ObjC";
248
-				PRODUCT_NAME = RCTWebView;
248
+				PRODUCT_NAME = RNCWebView;
249
 				SKIP_INSTALL = YES;
249
 				SKIP_INSTALL = YES;
250
 			};
250
 			};
251
 			name = Release;
251
 			name = Release;
253
 /* End XCBuildConfiguration section */
253
 /* End XCBuildConfiguration section */
254
 
254
 
255
 /* Begin XCConfigurationList section */
255
 /* Begin XCConfigurationList section */
256
-		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWebView" */ = {
256
+		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */ = {
257
 			isa = XCConfigurationList;
257
 			isa = XCConfigurationList;
258
 			buildConfigurations = (
258
 			buildConfigurations = (
259
 				58B511ED1A9E6C8500147676 /* Debug */,
259
 				58B511ED1A9E6C8500147676 /* Debug */,
262
 			defaultConfigurationIsVisible = 0;
262
 			defaultConfigurationIsVisible = 0;
263
 			defaultConfigurationName = Release;
263
 			defaultConfigurationName = Release;
264
 		};
264
 		};
265
-		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWebView" */ = {
265
+		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */ = {
266
 			isa = XCConfigurationList;
266
 			isa = XCConfigurationList;
267
 			buildConfigurations = (
267
 			buildConfigurations = (
268
 				58B511F01A9E6C8500147676 /* Debug */,
268
 				58B511F01A9E6C8500147676 /* Debug */,

ios/RCTWebView.xcworkspace/contents.xcworkspacedata → ios/RNCWebView.xcworkspace/contents.xcworkspacedata View File

3
 <Workspace
3
 <Workspace
4
    version = "1.0">
4
    version = "1.0">
5
    <FileRef
5
    <FileRef
6
-      location = "group:RCTWebView.xcodeproj">
6
+      location = "group:RNCWebView.xcodeproj">
7
    </FileRef>
7
    </FileRef>
8
 </Workspace>
8
 </Workspace>
9
-  

+ 6
- 6
js/WKWebView.ios.js View File

15
 
15
 
16
 import type {DataDetectorTypes} from './WebViewTypes';
16
 import type {DataDetectorTypes} from './WebViewTypes';
17
 
17
 
18
-const RCTWKWebView = requireNativeComponent('RCTWKWebView');
18
+const RNCWKWebView = requireNativeComponent('RNCWKWebView');
19
 
19
 
20
-type RCTWKWebViewProps = $ReadOnly<{|
20
+type RNCWKWebViewProps = $ReadOnly<{|
21
   allowsInlineMediaPlayback?: ?boolean,
21
   allowsInlineMediaPlayback?: ?boolean,
22
   mediaPlaybackRequiresUserAction?: ?boolean,
22
   mediaPlaybackRequiresUserAction?: ?boolean,
23
   dataDetectorTypes?:
23
   dataDetectorTypes?:
25
     | $ReadOnlyArray<DataDetectorTypes>,
25
     | $ReadOnlyArray<DataDetectorTypes>,
26
 |}>;
26
 |}>;
27
 
27
 
28
-class WKWebView extends React.Component<RCTWKWebViewProps> {
29
-  componentWillReceiveProps(nextProps: RCTWKWebViewProps) {
28
+class WKWebView extends React.Component<RNCWKWebViewProps> {
29
+  componentWillReceiveProps(nextProps: RNCWKWebViewProps) {
30
     this.showRedboxOnPropChanges(nextProps, 'allowsInlineMediaPlayback');
30
     this.showRedboxOnPropChanges(nextProps, 'allowsInlineMediaPlayback');
31
     this.showRedboxOnPropChanges(nextProps, 'mediaPlaybackRequiresUserAction');
31
     this.showRedboxOnPropChanges(nextProps, 'mediaPlaybackRequiresUserAction');
32
     this.showRedboxOnPropChanges(nextProps, 'dataDetectorTypes');
32
     this.showRedboxOnPropChanges(nextProps, 'dataDetectorTypes');
33
   }
33
   }
34
 
34
 
35
-  showRedboxOnPropChanges(nextProps: RCTWKWebViewProps, propName: string) {
35
+  showRedboxOnPropChanges(nextProps: RNCWKWebViewProps, propName: string) {
36
     if (this.props[propName] !== nextProps[propName]) {
36
     if (this.props[propName] !== nextProps[propName]) {
37
       console.error(`Changes to property ${propName} do nothing after the initial render.`);
37
       console.error(`Changes to property ${propName} do nothing after the initial render.`);
38
     }
38
     }
39
   }
39
   }
40
 
40
 
41
   render() {
41
   render() {
42
-    return <RCTWKWebView {...this.props} />;
42
+    return <RNCWKWebView {...this.props} />;
43
   }
43
   }
44
 }
44
 }
45
 
45
 

+ 15
- 14
js/WebView.ios.js View File

51
   return decelerationRate;
51
   return decelerationRate;
52
 }
52
 }
53
 
53
 
54
-const RCTUIWebViewManager = NativeModules.UIWebViewManager;
55
-const RCTWKWebViewManager = NativeModules.WKWebViewManager;
54
+const RNCUIWebViewManager = NativeModules.RNCUIWebViewManager;
55
+const RNCWKWebViewManager = NativeModules.RNCWKWebViewManager;
56
 
56
 
57
 const BGWASH = 'rgba(255,255,255,0.8)';
57
 const BGWASH = 'rgba(255,255,255,0.8)';
58
-const RCT_WEBVIEW_REF = 'webview';
59
 
58
 
60
 const WebViewState = keyMirror({
59
 const WebViewState = keyMirror({
61
   IDLE: null,
60
   IDLE: null,
143
     startInLoadingState: true,
142
     startInLoadingState: true,
144
   };
143
   };
145
 
144
 
145
+  webViewRef = React.createRef();
146
+
146
   UNSAFE_componentWillMount() {
147
   UNSAFE_componentWillMount() {
147
     if (this.props.startInLoadingState) {
148
     if (this.props.startInLoadingState) {
148
       this.setState({ viewState: WebViewState.LOADING });
149
       this.setState({ viewState: WebViewState.LOADING });
181
       );
182
       );
182
     } else if (this.state.viewState !== WebViewState.IDLE) {
183
     } else if (this.state.viewState !== WebViewState.IDLE) {
183
       console.error(
184
       console.error(
184
-        'RCTWebView invalid state encountered: ' + this.state.viewState,
185
+        'RNCWebView invalid state encountered: ' + this.state.viewState,
185
       );
186
       );
186
     }
187
     }
187
 
188
 
199
     let viewManager = nativeConfig.viewManager;
200
     let viewManager = nativeConfig.viewManager;
200
 
201
 
201
     if (this.props.useWebKit) {
202
     if (this.props.useWebKit) {
202
-      viewManager = viewManager || RCTWKWebViewManager;
203
+      viewManager = viewManager || RNCWKWebViewManager;
203
     } else {
204
     } else {
204
-      viewManager = viewManager || RCTUIWebViewManager;
205
+      viewManager = viewManager || RNCUIWebViewManager;
205
     }
206
     }
206
 
207
 
207
     const compiledWhitelist = [
208
     const compiledWhitelist = [
247
     let NativeWebView = nativeConfig.component;
248
     let NativeWebView = nativeConfig.component;
248
 
249
 
249
     if (this.props.useWebKit) {
250
     if (this.props.useWebKit) {
250
-      NativeWebView = NativeWebView || RCTWKWebView;
251
+      NativeWebView = NativeWebView || RNCWKWebView;
251
     } else {
252
     } else {
252
-      NativeWebView = NativeWebView || RCTWebView;
253
+      NativeWebView = NativeWebView || RNCUIWebView;
253
     }
254
     }
254
 
255
 
255
     const webView = (
256
     const webView = (
256
       <NativeWebView
257
       <NativeWebView
257
-        ref={RCT_WEBVIEW_REF}
258
+        ref={this.webViewRef}
258
         key="webViewKey"
259
         key="webViewKey"
259
         style={webViewStyles}
260
         style={webViewStyles}
260
         source={resolveAssetSource(source)}
261
         source={resolveAssetSource(source)}
292
 
293
 
293
   _getCommands() {
294
   _getCommands() {
294
     if (!this.props.useWebKit) {
295
     if (!this.props.useWebKit) {
295
-      return UIManager.RCTWebView.Commands;
296
+      return UIManager.RNCUIWebView.Commands;
296
     }
297
     }
297
 
298
 
298
-    return UIManager.RCTWKWebView.Commands;
299
+    return UIManager.RNCWKWebView.Commands;
299
   }
300
   }
300
 
301
 
301
   /**
302
   /**
389
    * Returns the native `WebView` node.
390
    * Returns the native `WebView` node.
390
    */
391
    */
391
   getWebViewHandle = () => {
392
   getWebViewHandle = () => {
392
-    return ReactNative.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);
393
+    return ReactNative.findNodeHandle(this.webViewRef.current);
393
   };
394
   };
394
 
395
 
395
   _onLoadingStart = (event: WebViewNavigationEvent) => {
396
   _onLoadingStart = (event: WebViewNavigationEvent) => {
451
   }
452
   }
452
 }
453
 }
453
 
454
 
454
-const RCTWebView = requireNativeComponent('RCTWebView');
455
-const RCTWKWebView = requireNativeComponent('RCTWKWebView');
455
+const RNCUIWebView = requireNativeComponent('RNCUIWebView');
456
+const RNCWKWebView = requireNativeComponent('RNCWKWebView');
456
 
457
 
457
 const styles = StyleSheet.create({
458
 const styles = StyleSheet.create({
458
   container: {
459
   container: {