0.0.2 • Published 5 years ago

jreact v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

JsonReact

通过json来渲染生成react node 从而来达到json渲染页面的效果

example

npm run example

test

npm run test

如何定义一个Json自定义组件

type JRComponent = {
  name?: string, // 组件名称
  reducer?: Reducer<any, any>, // 组件的reducer 控制组件的数据
  Cls: React.ComponentType<any>, // 组件的实现
  actionKeys?: StringMap<DescribableKey>, // 组件的处罚reducer的key
  eventKeys?: StringMap<DescribableKey> // 组件的可触发事件的描述
}