Skip to content

DmShpak/react-json-pn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'))

About

React Components based on JSON templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published