UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

15 lines (13 loc) 440 B
import error from './error' export default function renderNode ($$, component, node) { var componentRegistry = component.context.componentRegistry || component.props.componentRegistry var ComponentClass = componentRegistry.get(node.type) if (!ComponentClass) { error('Could not resolve a component for type: ' + node.type) return $$('div') } return $$(ComponentClass, { node: node, doc: node.getDocument() }) }