I am loading Three.JS Model using WebView in my react-native app. After loading the Model the memory is increased.
Now when i tap on button i want to deallocate the webView Component and want release the memory.
OR when i go to next screen i would like to release the memory.
Below is my code.
{this.state.showWebview &&
<WebView
ref={(wbref) => {
this.webview = wbref;
}}
style={styles.middleview}
source={{
uri: this.state.showWebview && this.props.isCurrentScreenOnTop
? '3DMODEL/vechicle.html'
: null,
}}
onLoadStart={this.onLoadStart}
onLoad={this.onLoad}
onLoadEnd={this.onLoadEnd}
onError={this.onError}
renderError={this.renderError}
onMessage={this.handleMessageFromBuilder}
cacheEnabled={false}
cookiesEnabled={false}
/>}
componentWillUnmount() {
this.webview = null;
}
Below is the memory graph.

add prop
useWebkit={true}
and the memory will allocate a little.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With