-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render without a parameter 'el' #47
Comments
Does other ui libs like react or vue support detached rendering? I think we can figure out something for new version of monkberry. |
Yes, at least for React. Here is the first example on reactjs.org with the JSX syntax:
After compilation to JS:
The call to Notice: |
Okay, but lets wait until I finish v5 as it will have a little different abstractions. |
My main use case is with a template with one root element. For example:
Then, I need to create the DOM element as a detached element, without to insert it immediately. Currently I use the following code:
And here is what I would like to do:
I suggest to:
el
optional, or create a new exported functionrenderDetached
without this parameter;singleNode
, that throws an Error whenview.nodes.length !== 1
, and returns the single node otherwise. Or a classic membersingleNode
that isundefined
whenview.nodes.length !== 1
.I think I could implement it but I saw you have started a huge redesign…
(Regarding your redesign, I suggest you to leave Babel for the server part. Recent versions of Node.js can work with ES 6, 7, 8, except for the
import
/export
.)The text was updated successfully, but these errors were encountered: