Skip to content
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

Fix full-page rendering #339

Merged
merged 1 commit into from
Sep 11, 2013
Merged

Fix full-page rendering #339

merged 1 commit into from
Sep 11, 2013

Conversation

sophiebits
Copy link
Collaborator

Closes #337.

Test Plan:
Opened react-page sample without any JS errors. Also ran grunt test after cherry-picking this changeset on top of #338.

/cc @petehunt @jwalke

@petehunt
Copy link
Contributor

This won't work if I want to full page render an iframe. Shouldn't we refer to container instead of document directly?

Closes facebook#337.

Test Plan:
Opened react-page sample without any JS errors. Also ran grunt test after cherry-picking this changeset on top of facebook#338.
@sophiebits
Copy link
Collaborator Author

Yep, typo -- sorry. Just fixed.

@petehunt
Copy link
Contributor

I like but can't merge now, @zpao if you're still on the ground I'm good for this to be merged.

@jordwalke
Copy link
Contributor

@spicyj: Did you test on react-page without my latest (hack) react-page commit (in react-page-middleware)? That would be the true test.

@sophiebits
Copy link
Collaborator Author

Yes, I already tested that (adding a __VERSION__ fix but without monkeypatching prepareEnvironmentForDOM) and it works correctly.

@@ -235,13 +238,16 @@ var ReactMount = {
*/
prepareEnvironmentForDOM: function(container) {
invariant(
container && container.nodeType === 1,
container && (
container.nodeType === ELEMENT_NODE_TYPE ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think of this earlier (and I'm not going to block this diff), but we should probably consider using Node.ELEMENT_NODE and Node.DOCUMENT_NODE).

zpao added a commit that referenced this pull request Sep 11, 2013
@zpao zpao merged commit 63bacfa into facebook:master Sep 11, 2013
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.

Fails on whole-document rendering
4 participants