Last active
October 30, 2019 15:47
-
-
Save 3jedgcm/7dc158b857ad4255a708b792d3515c70 to your computer and use it in GitHub Desktop.
Fix Issue to WebView in React Native. Collapse this component to Webview. https://github.com/react-native-community/react-native-webview/issues/6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: 3jedgcm | |
*/ | |
import React from 'react' | |
import {View} from 'react-native' | |
class FixWebView extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
height: 0 | |
} | |
} | |
componentDidMount() { | |
setInterval(() => { | |
let newHeight = this.state.height == 0 ? 1 : 0 | |
this.setState({ | |
height: newHeight | |
}) | |
}, 100) | |
} | |
render() { | |
return ( | |
<View style={{ width: 1, height: this.state.height}} /> | |
) | |
} | |
} | |
export default FixWebView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment