1
I need to display a message on screen while the Webview component has not fully loaded, but I don’t know how to detect if it has already loaded the content. Here is my code:
return (
<View style={styles.container}>
<WebView
style={styles.webview}
setSupportMultipleWindows={false}
ref={this.WEBVIEW_REF}
javaScriptEnabled={true}
allowsFullscreenVideo={true}
onNavigationStateChange={this.onNavigationStateChange}
source={{ uri: 'https://pei.educacao.mg.gov.br/login' }} />
</View>
);
The answer is correct, just bounce here for attention when using Arrow functions in render. As mentioned in documentation: "When using an Arrow Function in render, a new function is created each time the component is rendered, which can break optimizations based on identity comparison
on strict
." I prefer to avoid and make use of a Eslint rule to alert myself to this: React/jsx-no-bind– Rafael Tavares