Skip to content

passy/react-frame-component

 
 

Repository files navigation

React <Frame /> component

NPM version Build Status Dependency Status

This component allows you to encapsulate your entire React application or per component in an iFrame.

npm install --save react-frame-component

How to use:

This is a UMD module so you can include however you like.

UMD what now?

If you're not sure what that is you can include this as a <script> tag in your site and it will be available as a Frame global.

Go check out the [demo] demo-url.

var Header = React.createClass({
  render: function() {
    return (
      <Frame>
        <h1>{this.props.children}</h1>
      </Frame>
    );
  }
});

React.renderComponent(<Header>Hello</Header>, document.body);

Or you can wrap it at the renderComponent call.

React.renderComponent(
  <Frame>
    <Header>Hello</Header>
  </Frame>,
  document.body
);

License

Copyright 2014, Ryan Seddon. This content is released under the MIT license http://ryanseddon.mit-license.org

About

Render your React app to an iFrame

Resources

Stars

Watchers

Forks

Packages

No packages published