Skip to content

Instantly share code, notes, and snippets.

@dy
Last active November 16, 2022 21:38
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 dy/f664e5c734edf5230c9975edaf37a566 to your computer and use it in GitHub Desktop.
Save dy/f664e5c734edf5230c9975edaf37a566 to your computer and use it in GitHub Desktop.
element.render
// what if we had simple method on elements, taking in VDOM pieces?
// * it makes sure there's no internal content that messes up rendering
// * it allows simple function as input - something prohibited by preact
// * it enables element existence check
element?.render(({props}) => <div></div>);
element?.render(<div></div>);
element?.render(<Element></Element>);
function Element({props}) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment