revolunet / react-umd-loader

Async load any remote UMD compatible React component into your app.

Home Page:http://revolunet.github.io/react-umd-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-umd-loader experimental

npm version

Async load any remote UMD compatible React component into your app.

This component use script.js for loading the remote component.

See also : React jspm loader

Usage

You can use unpkg.com or whatever hosting. The only requirement is that the build supports UMD.

This example loads the remote react-json-viewer component into our app

import UmdLoader from 'react-umd-loader'

let cmp = (<UmdLoader url="https://npmcdn.com/react-json-viewer@1.0.9" name="ReactJSONViewer" props={ props }>
             <p>Loading remote component...</p>
           </UmdLoader>);

As UMD exposes objects on window, you also need to define the name of the final module.

Dev

This project use the great react-component-boilerplate

About

Async load any remote UMD compatible React component into your app.

http://revolunet.github.io/react-umd-loader

License:MIT License


Languages

Language:JavaScript 100.0%