Last active
November 16, 2022 21:38
-
-
Save dy/f664e5c734edf5230c9975edaf37a566 to your computer and use it in GitHub Desktop.
element.render
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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