Unsupported top level event type "topLoadingStart" dispatched in Custom WebView
See original GitHub issueIs this a bug report?
I believe so.
Have you read the Contributing Guidelines?
Yes.
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.7.0 Yarn: 1.2.1 npm: 5.4.2 Watchman: 4.7.0 Xcode: Xcode 9.1 Build version 9B55 Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.50.3 => 0.50.3
Target Platform: iOS (11.1)
Steps to Reproduce
We implemented a Custom WebView. It used to work in RN 0.49 (we were using the components/WebView.ios.js from master). I’m not an Objective-C developer and probably I’m doing something wrong. Our implementation looks like this:
// RCTCustomWebViewManager.h
#import <React/RCTWebViewManager.h>
#import <React/RCTWebView.h>
@interface RCTCustomWebViewManager : RCTWebViewManager
@end
// RCTCustomWebViewManager.m
#import "RCTCustomWebViewManager.h"
@interface RCTCustomWebViewManager () <RCTWebViewDelegate>
@end
@implementation RCTCustomWebViewManager { }
RCT_EXPORT_MODULE()
RCT_REMAP_VIEW_PROPERTY(keyboardDisplayRequiresUserAction, _webView.keyboardDisplayRequiresUserAction, BOOL)
- (UIView *)view
{
RCTWebView *webView = [RCTWebView new];
webView.delegate = self;
return webView;
}
@end
Expected Behavior
I expect it works.
Actual Behavior
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Unsupported top level event type "topScroll" dispatched
The error occurs when running in the simulator and on the device (from xcode). This is the code to my application. I'm sure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems related to how events are resolved in
requireNativeComponent.js
Spent a bit of time investigating this, and was about to submit a PR, but seems like @shergin already fixed this in master: https://github.com/facebook/react-native/commit/2afe7d4765ffc0d0c71d233211edd1d21972040e
So it will probably be working again in a future version of RN 👍
Edit: The reason why
topLoadingStart
was not referenced in the iOS code is because there’s a name-normalization method for events for iOS: https://github.com/facebook/react-native/blob/d2c569795ca07b6b7c0227cfc6d0b3bf5dd23b99/React/Base/RCTEventDispatcher.m#L20 Bit hacky, and makes debugging more difficult, but oh well. Yet another gotcha 😃Quickly tested it out, and was able to reproduce the same error.
Regarding:
This should not be the case any more. With #14775 inheritance works on iOS as well.
I am not sure where the
topLoadingStart
event is coming from though. Searching through the code base I only find references in Android-code. Might be something changed with events on iOS from RN0.49
->0.50
.Maybe @javache knows?