react-native-autoheight-webview
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -77,10 +77,2 @@ 'use strict' | ||
// componentDidUpdate(prevProps, prevState) { | ||
// // redisplay webview when changing source | ||
// if (this.state.isChangingSource) { | ||
// this.startInterval(); | ||
// this.setState({ isChangingSource: false }); | ||
// } | ||
// } | ||
componentWillUnmount() { | ||
@@ -98,10 +90,2 @@ this.stopInterval(); | ||
postMessage(data) { | ||
UIManager.dispatchViewManagerCommand( | ||
findNodeHandle(this.webview), | ||
UIManager.RCTAutoHeightWebView.Commands.postMessage, | ||
[String(data)] | ||
); | ||
}; | ||
// below kitkat | ||
@@ -116,2 +100,10 @@ sendToWebView(message) { | ||
postMessage(data) { | ||
UIManager.dispatchViewManagerCommand( | ||
findNodeHandle(this.webview), | ||
UIManager.RCTAutoHeightWebView.Commands.postMessage, | ||
[String(data)] | ||
); | ||
}; | ||
startInterval() { | ||
@@ -215,7 +207,9 @@ this.finishInterval = false; | ||
AutoHeightWebView.propTypes = { | ||
enableAnimation: PropTypes.bool, | ||
source: WebView.propTypes.source, | ||
onHeightUpdated: PropTypes.func, | ||
customScript: PropTypes.string, | ||
// offset rn webview margin | ||
enableAnimation: PropTypes.bool, | ||
// only works on enable animation | ||
animationDuration: PropTypes.number, | ||
// offset of rn webview margin | ||
heightOffset: PropTypes.number, | ||
@@ -234,2 +228,3 @@ // baseUrl not work in android 4.3 or below version | ||
AutoHeightWebView.defaultProps = { | ||
enableAnimation: true, | ||
animationDuration: 555, | ||
@@ -236,0 +231,0 @@ enableBaseUrl: false, |
@@ -108,9 +108,9 @@ 'use strict' | ||
AutoHeightWebView.propTypes = { | ||
source: WebView.propTypes.source, | ||
onHeightUpdated: PropTypes.func, | ||
customScript: PropTypes.string, | ||
enableAnimation: PropTypes.bool, | ||
// only works on enable animation | ||
animationDuration: PropTypes.number, | ||
source: WebView.propTypes.source, | ||
onHeightUpdated: PropTypes.func, | ||
customScript: PropTypes.string, | ||
// offset rn webview margin | ||
// offset of rn webview margin | ||
heightOffset: PropTypes.number, | ||
@@ -127,2 +127,3 @@ style: View.propTypes.style, | ||
AutoHeightWebView.defaultProps = { | ||
enableAnimation: true, | ||
animationDuration: 555, | ||
@@ -129,0 +130,0 @@ heightOffset: 12 |
{ | ||
"name": "react-native-autoheight-webview", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "An auto height webview for React Native", | ||
@@ -5,0 +5,0 @@ "main": "autoHeightWebView", |
@@ -17,6 +17,11 @@ # react-native-autoheight-webview | ||
<AutoHeightWebView | ||
onHeightUpdated={height => console.log(height)}, | ||
// offset of rn webview margin | ||
heightOffset={5} | ||
// default width is the width of screen | ||
style={customStyle} | ||
// enable animation by default | ||
enableAnimation={true}, | ||
// only works on enable animation | ||
animationDuration={255}, | ||
onHeightUpdated={height => console.log(height)} | ||
// or uri | ||
@@ -23,0 +28,0 @@ source={{ html: `<p style="font-weight: 400;font-style: normal;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;">Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. <span style="background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));">If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with “moving”. I’d also use the tags “pets”, “marriage”, “career change”, and “travel tips”.</span></p>` }} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83049
37
361