wavesoft / dot-dom

.dom is a tiny (512 byte) template engine that uses virtual DOM and some of react principles
Apache License 2.0
809 stars 53 forks source link

Pass-through DOM elements #46

Closed wavesoft closed 5 years ago

wavesoft commented 5 years ago

This PR enables regular DOM elements to be used in place of Virtual Nodes. Such feature can be useful for cases such as the one requested in #45

This practically enables the following:

// The components can return DOM elements
const AdvancedComponent = (props) => {
  const elm = document.createElement('div');  
  FancyEditor.init(elm);
  return elm;
};

// Render
R(H(AdvancedComponent), document.body);