@flow-editor/render
Version:
Dawn数据流的React实现
20 lines (18 loc) • 473 B
JavaScript
import React from 'react';
export function DawnBrickDispatcher(_ref) {
var config = _ref.config,
model = _ref.model,
scope = _ref.scope;
var ctx = model.getOwnerContext();
var Component = ctx.getBrickConfigs(config.type);
if (!Component) {
console.error('Component: ' + config.type + ' is not found');
return null;
}
return React.createElement(Component, {
key: config.id,
model: model,
scope: scope,
config: config
});
}