auto-sizing-webview
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,6 +8,18 @@ // @flow | ||
} from 'react-native'; | ||
import { mergedStyle } from '../utils/UiUtils'; | ||
// user is responsible for given us a proper width through layout or width | ||
export default class AutoSizingWebView extends Component { | ||
static mergedStyle(...args) { | ||
if (args.length === 1) { | ||
return args[0] || {}; | ||
} | ||
return args.reduce( | ||
(ret, item) => ((Array.isArray(item) ? | ||
ret.concat(item) | ||
: [...ret, item] | ||
), | ||
[] | ||
); | ||
} | ||
state: {height: number} | ||
@@ -31,3 +43,3 @@ _onNavigationStateChange: (event: Object) => void | ||
_style() { | ||
return mergedStyle( | ||
return this.constructor.mergedStyle( | ||
{ | ||
@@ -34,0 +46,0 @@ height: this.state.height, |
{ | ||
"name": "auto-sizing-webview", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "use scrollHeight to find content height for WebView, and do proper layout, inspired by code from here: https://gist.github.com/dbasedow/ed6e099823cb8d5ab30e", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
2248
58