JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q38746F
  • License MIT

react component for create isolated view frames

Package Exports

  • react-sandbox-frame

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-sandbox-frame) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Sandbox Frame

this package create an customizable and declarative iframe

usage

import React, { Component } from 'react'
import Frame from 'react-sandbox-frame'

export class WebView extends Component {

  /**
   * connect frame and you component
   * @param {HTMLElement} document
   */
  onLoad (document) {
    console.log(document) // output <p>hello world</p>
  }

  render () {
    return (
      <Frame onLoad={this.onLoad.bind(this)}>
        <p>hello world</p>
      </Frame>
    )
  }

}

Optional Props

The Frame component takes a couple of props that you can use to customize its behaviour:

  • children [?element]
  • onLoad [?function]
  • src [?string]
  • style [?object]
  • title [?string=page-wrapper]
  • stylesheets [?Array<String>=[]]
  • scripts [?Array<String>=[]]