Skip to content

Instantly share code, notes, and snippets.

@Tevinthuku
Last active August 14, 2019 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tevinthuku/d0f17ef7ab3be58fd2a485d58cfbdfe6 to your computer and use it in GitHub Desktop.
Save Tevinthuku/d0f17ef7ab3be58fd2a485d58cfbdfe6 to your computer and use it in GitHub Desktop.
const HOST_ROOT = "root";
const HOST_COMPONENT = "host";
// code..
export function render(elements, containerDom) {
workQueue.push({
from: HOST_ROOT, // the root/parent fiber
dom: containerDom, // document.getElementById("app") just a dom node where this fiber will be appended to as a child
newProps: { children: elements }
});
requestIdleCallback(performWork);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment