Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Move nested frames examples to sink
Browse files Browse the repository at this point in the history
  • Loading branch information
suchipi committed Feb 22, 2017
1 parent d16bec5 commit 2ff3105
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 89 deletions.
57 changes: 57 additions & 0 deletions test/example/sink.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,61 @@ class LotsOfMounts extends React.Component {
}
}

class IframeWrapper extends React.Component {
componentDidMount() {
this.root = document.createElement('div');
this.frame.contentDocument.body.appendChild(this.root);
ReactDOM.render(this.props.children, this.root);
}

componentWillUnmount() {
ReactDOM.unmountComponentAtNode(this.root);
}

render() {
var { children, ...props } = this.props; // eslint-disable-line no-unused-vars

return (
<div>
<div>Iframe below</div>
<iframe ref={frame => this.frame = frame} {...props} />
</div>
);
}
}

class InnerContent extends React.Component {
render() {
return (
<div>
Inner content (highlight should overlap properly)
</div>
);
}
}

class IframeWithMountedChild extends React.Component {
render() {
return (
<IframeWrapper>
<InnerContent />
</IframeWrapper>
);
}
}

class NestedMountedIframesWithVaryingBorder extends React.Component {
render() {
return (
<IframeWrapper>
<IframeWrapper frameBorder="0">
<InnerContent />
</IframeWrapper>
</IframeWrapper>
);
}
}

// Render the list of tests

class Sink extends React.Component {
Expand All @@ -147,6 +202,8 @@ class Sink extends React.Component {
BadUnmount,
Nester,
LotsOfMounts,
IframeWithMountedChild,
NestedMountedIframesWithVaryingBorder,
};

var view = Comp => run(View, {Comp});
Expand Down
1 change: 0 additions & 1 deletion test/nested-frames/.gitignore

This file was deleted.

59 changes: 0 additions & 59 deletions test/nested-frames/target.js

This file was deleted.

29 changes: 0 additions & 29 deletions test/nested-frames/webpack.config.js

This file was deleted.

0 comments on commit 2ff3105

Please sign in to comment.