Skip to content

Conversation

@Hex-001
Copy link
Contributor

@Hex-001 Hex-001 commented Jul 29, 2018

Added postMessage support to the webview component.

Copy link
Member

@Minishlink Minishlink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Can you change the strategy as stated in the code comments please?

src/index.js Outdated
const { title, source, onLoad, scrollEnabled } = this.props;
const styleObj = StyleSheet.flatten(this.props.style);
return createElement('iframe', {
let contentFrame = createElement('iframe', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep return createElement (you don't need contentFrame afterwards)

src/index.js Outdated
return createElement('iframe', {
let contentFrame = createElement('iframe', {
title,
id: elementId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a DOM ref on the iframe and don't rely on this elementId

…ed. Ref used on iframe and postMessage is called on ref rather than using element id.
Copy link
Member

@Minishlink Minishlink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Minishlink Minishlink merged commit 92eda7b into react-native-web-community:master Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants