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

Revert #4993 with an added test for refs #5394

Merged
merged 1 commit into from
Nov 5, 2015

Conversation

sophiebits
Copy link
Collaborator

We were shallow-rendering a component that used refs at FB so this can't go in as-is. It's a little unclear what we should do though, since there is nothing to hold a ref to (since we're shallowly rendering) and we generally promise that child refs are resolved before a parent's componentDidMount. Also, changing shallow rendering to use the original _renderValidatedComponent (instead of _renderValidatedComponentWithoutOwnerOrContext) breaks tests because now the _owner field doesn't match up for toEqual (non-null in getRenderOutput but null if constructed in a test).

@zpao
Copy link
Member

zpao commented Nov 5, 2015

But the new test fails?

We were shallow-rendering a component that used refs at FB so this can't go in as-is. It's a little unclear what we _should_ do though, since there is nothing to hold a ref to (since we're shallowly rendering) and we generally promise that child refs are resolved before a parent's componentDidMount. Also, changing shallow rendering to use the original `_renderValidatedComponent` (instead of `_renderValidatedComponentWithoutOwnerOrContext`) breaks tests because now the `_owner` field doesn't match up for `toEqual` (non-null in `getRenderOutput` but null if constructed in a test).
@sophiebits
Copy link
Collaborator Author

Oops, I screwed up the change. That's what tests are for. Fixed.

@zpao
Copy link
Member

zpao commented Nov 5, 2015

Diffing is too smart so it's hard to tell that it was a clean revert with just a new test below… If only there was some way to clearly separate changes into 2 distinct operations 😛

@sophiebits
Copy link
Collaborator Author

Well I had to patch the original PR because of a conflict so it would've been two commits to revert anyway.

sophiebits added a commit that referenced this pull request Nov 5, 2015
Revert #4993 with an added test for refs
@sophiebits sophiebits merged commit e131357 into facebook:master Nov 5, 2015
@facebook-github-bot
Copy link

@spicyj updated the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants