Skip to content

Instantly share code, notes, and snippets.

Created April 26, 2017 18:46
What would you like to do?
function render(element, parentDom) {
const { type, props } = element;
const dom = document.createElement(type);
const childElements = props.children || [];
childElements.forEach(childElement => render(childElement, dom));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment