UNPKG

purplejs

Version:

A little bit of React

17 lines (13 loc) 433 B
import ElementObject from '../interfaces/element-object' import Instance from '../interfaces/instance' import Component from '../component/index' export default ( element: ElementObject, instance: Instance | object, ): Component => { const { type, props } = element const TypeComponent: any = type const publicInstance = new TypeComponent(props) publicInstance._internalInstance = instance return publicInstance }