npm.io
1.0.3 • Published 7 years ago

reapex-plugin-component-registry

Licence
MIT
Version
1.0.3
Deps
1
Size
19 kB
Vulns
0
Weekly
0

Reapex modal plugin

import { App } from 'reapex'
import registryPlugin from 'reapex-plugin-component-registry'

const app = new App()

// 1. register the plugin
const registry = app.plugin(registryPlugin, '@@registry')

// 2. register a component
const ComponentA: React.FC<{}> = () =>
  <div>
    This is ComponentA A
  </div>

registry.register('ComponentA', ComponentA)

// use the registered component
<registry.Component name="ComponentA" />

Keywords