-
Notifications
You must be signed in to change notification settings - Fork 48.5k
Removed context paremeter to renderToString/renderToStaticMarkup. #2565
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
Conversation
Thanks. |
(Though #2566 has this and more.) |
Delete this argument. The second argument shouldn't exist. It's always empty context. |
Ok, second argument deleted. |
Can you update the title of the PR for reference? To clarify the rationale here... We shouldn't accept any contexts from the outside of top-level because we may want to connect a context from another React subtree that generated this subtree. E.g. for layers. But we may also want to put DOM specific context on there by default. E.g. current focus/selection. |
I actually don't understand that answer. Wanting to "connect a context from another React subtree" or "want to put a DOM specific context on there by default" both seem like reasons we SHOULD have the second argument. Perhaps you can explain it to me in more detail on Friday. |
Removed context paremeter to renderToString/renderToStaticMarkup.
In short, it's because we don't KNOW how we will do this and as soon as we add a new API we will have 10-30 users of it by tomorrow. We might want to auto-attach it implicitly and not require it to be passed through. Explicit pass-through doesn't really work when the context is masked. |
Ah, got it! Makes sense :). |
Fixed whitespace after 'if' statement as per style guidelines