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

Prevent incorrect options SSR hydrate mismatch, fix #11602 #12088

Closed
wants to merge 1 commit into from

Conversation

t4deu
Copy link

@t4deu t4deu commented Jan 24, 2018

This fix #11602, the warning "Text content did not match", when hydrating a select with a value.

Caused by a regression that overwrites the children nodes of a option when setting the selected option. As you can see here, the previous version only overwrites the selected prop

Before submitting a pull request, please make sure the following is done:

  • Fork the repository and create your branch from master.
  • Run yarn in the repository root.
  • If you've fixed a bug or added code that should be tested, add tests!
  • Ensure the test suite passes (yarn test). Tip: yarn test --watch TestName is helpful in development.
  • Run yarn test-prod to test in the production environment. It supports the same options as yarn test.
  • If you need a debugger, run yarn debug-test --watch TestName, open chrome://inspect, and press "Inspect".
  • Format your code with prettier (yarn prettier).
  • Make sure your code lints (yarn lint). Tip: yarn linc to only check changed files.
  • Run the Flow typechecks (yarn flow).
  • If you haven't already, complete the CLA.

Avoid overwrite options children nodes when setting the selected option.
@t4deu
Copy link
Author

t4deu commented Jan 24, 2018

Hi @gaearon, if possible, could you review this PR please, thank you so much!

@gaearon
Copy link
Collaborator

gaearon commented Aug 2, 2018

Thanks for the PR. I don't think this was the right fix, but it looks like #13261 took care of this. I'll add a regression test based on your PR.

@gaearon gaearon closed this Aug 2, 2018
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.

Children of option tags flattened when select has value
3 participants