-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Support for string targets for isomorphic createPortal #10711
Comments
See also discussion in #8386: #8386 (comment) |
Have there been discussions on how this might translate to non-DOM environments that might not have the |
Portal implementation itself is agnostic of what you pass as a second argument as long as it's a valid container (i.e. the thing you do the top level render into). For DOM it's a DOM node but for other environments it could be anything that top level render container could be. |
Was there a reason the function arg approach wasn't used ? I see it being suggested but not discussed. Is the recommendation to use a |
@gaearon Yes, Node/View objects would translate naturally to other environments, but the idea of the string argument might rely on the environments capabilities to query the view hierarchy with the specified selector; This exists as So that might affect this proposal as far as an isomorphic solution is concerned. |
@thysultan it would be a selector for the DOM renderer, but the string could signify some other target in the other renderers. It would be up to the renderer to determine how to resolve the target based on the string, so there's no inherent coupling to |
Related: when we do this we might also want to consider renaming it to |
Are there any new updates on this topic ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
This is a proposal for the
createPortal
API to in addition to Nodes support strings for the second argument(container), which could pave a declarative way to achieve out of order server side rendering.The server could render a portals children in-place and have the client-side hydration process move it to the right location client-side using
document.querySelector
if the container is a string.The text was updated successfully, but these errors were encountered: