Nonlinear Performance Magnification

    react-inline-frame

    0.0.6 • Public • Published

    react-inline-frame

    npm version

    React iframe component

    Installation

    npm install react-inline-frame

    Usage

    import React from "react";
    import ReactIframe from "react-inline-frame";
     
    class ReactIframeDemo extends React.Component {
      onIframeLoad = event => {
        console.log("onIframeLoad");
     
        this.iframe.postMessage({
          type: "greeting",
          content: ["Hello", "Bonjour", "你好"]
        });
      };
     
      onIframeMessage = (message, event) => {
        console.log("onIframeMessage", message);
      };
     
      render() {
        return (
          <ReactIframe
            className="iframe-demo"
            title="iframe-demo"
            src="./embed.html"
            ref={el => {
              this.iframe = el;
            }}
            onLoad={this.onIframeLoad}
            onMessage={this.onIframeMessage}
          />
        );
      }
    }

    License

    MIT

    Keywords

    Install

    npm i react-inline-frame

    DownloadsWeekly Downloads

    1

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    20.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • dearke