Skip to content

Removed context paremeter to renderToString/renderToStaticMarkup. - #2565

Merged
jimfb merged 1 commit into
react:masterfrom
jimfb:fixwhitespace
Nov 19, 2014
Merged

jimfb merged 1 commit into
react:masterfrom
jimfb:fixwhitespace

Conversation

@jimfb

@jimfb jimfb commented Nov 19, 2014

Copy link
Copy Markdown
Contributor

Fixed whitespace after 'if' statement as per style guidelines

@sophiebits

Copy link
Copy Markdown
Collaborator

Thanks.

@sophiebits

Copy link
Copy Markdown
Collaborator

(Though #2566 has this and more.)

@sebmarkbage

Copy link
Copy Markdown
Contributor

Delete this argument. The second argument shouldn't exist. It's always empty context.

@jimfb

jimfb commented Nov 19, 2014

Copy link
Copy Markdown
Contributor Author

Ok, second argument deleted.

@sebmarkbage

Copy link
Copy Markdown
Contributor

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.

@jimfb jimfb changed the title Fixed whitespace after 'if' statement as per style guidelines Removed context paremeter to renderToString/renderToStaticMarkup. Nov 19, 2014
@jimfb

jimfb commented Nov 19, 2014

Copy link
Copy Markdown
Contributor Author

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.

jimfb added a commit that referenced this pull request Nov 19, 2014
Removed context paremeter to renderToString/renderToStaticMarkup.
@jimfb
jimfb merged commit 6ec9529 into react:master Nov 19, 2014
@jimfb jimfb mentioned this pull request Nov 19, 2014
3 tasks done
@jimfb
jimfb deleted the fixwhitespace branch November 19, 2014 23:52
@sebmarkbage

Copy link
Copy Markdown
Contributor

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.

@jimfb

jimfb commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

Ah, got it! Makes sense :).

mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Removed context paremeter to renderToString/renderToStaticMarkup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants