Description
WebView has no proper flowtypes.
Reproduction Steps and Sample Code
Environment
react-native: 0.43.4flow-bin: 0.40.0
- import WebView
- use it
- attempt to access props or exposed functions
- observe that props and exposed methods (
injectJavaScript, for example) are not covered by flow.
// @flowimportReact,{PureComponent}from'react';import{WebView,View,Button}from'react-native';importhtmlTemplatefrom'./template.html';exportdefaultclassTestComponentextendsPureComponent{webview: ?WebView=null;handlePress=()=>{const{webview}=this;if(webview){constscript="alert('sup :3')";webview.injectJavaScript(script);}};render(){<View><ButtononPress={this.handlePress}>
Press me!
</Button><WebViewref={(webview: WebView)=>{this.webview=webview;}}source={htmlTemplate}/></View>;}}Solution
Add missing flowtypes to WebView.
Additional Information
- React Native version:
0.43.4 - Platform: both
- Development Operating System: MacOS
- Dev tools: N/A
Description
WebView has no proper flowtypes.
Reproduction Steps and Sample Code
Environment
react-native: 0.43.4flow-bin: 0.40.0injectJavaScript, for example) are not covered by flow.Solution
Add missing flowtypes to WebView.
Additional Information
0.43.4