react-umd-loader-uni

2.0.1 • Public • Published

react-umd-loader-uni experimental

npm version

Fork info

This is fork of react-umd-loader which can also load ES6 React modules in UMD format. This version supports React 16. For support of earlier versions of React, use version 1.x of this library.

Original readme

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-uni'
 
let cmp = (<UmdLoader url="https://rawgit.com/coryhouse/my-component/master/umd/my-component.js" name="MyComponent" props={{ username: 'Person', message: 'you are here' }}>
             <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

Package Sidebar

Install

npm i react-umd-loader-uni

Weekly Downloads

3

Version

2.0.1

License

MIT

Last publish

Collaborators

  • andriyf