react-module-loader
v1.0.10
Published
Loads ES6 modules (functions, etc) within a React component as a procedurally generated interactive view element
Downloads
24
Readme
React Module Loader
Loads ES6 modules (functions, etc) into interactive React component views.
Allows bootstrapping a set of functions (properly exported as ES6 modules & documented with a JSDOC AST), into an auto-generated input interface, which is reusable & composable for myriad use-cases.
Linted with ESLint and tested with Mocha, Enzyme and JSDOM.
There is also ES6 transpilation.
Usage
via NPM
- Install the package
npm install --save react-module-loader
- Include package into your app with:
import ReactModuleLoader from 'react-module-loader
- Add
ReactModuleLoader
to your render() method. - You must pass the element 3 props:
- A
mount
prop (the parent object that is a properly exported ES6 module) - A
functionsKeyName
prop (the keyname of the child object ofmount
that holds the actual functions themselves). - A
astKeyName
prop (the keyname of a the child object ofmount
that is a jsdoc-generated JSON AST, exported as a module).
- A
Relevant blog post:
- Auto-Generating React Components from ES6 Modules (blog post coming soon.)
Also check out:
- ES6 Module Syntax
- more coming soon...
License
MIT