0.0.2 • Published 6 years ago
react-json-pn v0.0.2
react-json-pn
Create stateless React component from JSON templates
Motivation
React project can not import components from untrusted place. It makes moving of UI templates to external configuration hard. The main idea of react-json-pn is to use ui templates in JSON form.
Usage
Include
import { createCompiler } from 'json-pn'
import { createComponentFactory } from 'react-json-pn'
Create components factory
const componentsFactory = createComponentFactory(createCompiler())
Create component from JSON template
const HelloWord = componentsFactory(['div', {}, 'Hello Word'])
Use component in your project
render( <HelloWord />, document.getElementById('root_id'))