react-json-render
v0.5.1
Published
render json to react component
Downloads
11
Readme
react-json-render
使用 json 格式去渲染 react 组件
此仓库只是渲染引擎,不包含任何组件,要查看集成的组件可以查看 antd-json-render
import { createJsonRender } from 'react-json-render'
const {type, render} = createJsonRender()
type.add('button', (props) => {
return <button>{props.text}</button>
})
class App extends React.Component {
render() {
return render({$: 'button', text: 'foo'}) // this will create `<button>foo</button>`
}
}