Skip to content

Instantly share code, notes, and snippets.

@3jedgcm
Last active October 30, 2019 15:47
Show Gist options
  • Save 3jedgcm/7dc158b857ad4255a708b792d3515c70 to your computer and use it in GitHub Desktop.
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
/*
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