Skip to content

Make uncontrolled -> controlled warning clearer - #17070

Merged
gaearon merged 7 commits into
react:masterfrom
vcarl:patch-1
Apr 7, 2020
Merged

Make uncontrolled -> controlled warning clearer#17070
gaearon merged 7 commits into
react:masterfrom
vcarl:patch-1

Conversation

@vcarl

@vcarl vcarl commented Oct 11, 2019

Copy link
Copy Markdown
Contributor

Fixes #17069. Glad to iterate further on the specific language, but I've found that explaining in this way usually clears it up for people.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@sizebot

sizebot commented Oct 11, 2019

Copy link
Copy Markdown

No significant bundle size changes to report.

Generated by 🚫 dangerJS against eb7d88f

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@markerikson

Copy link
Copy Markdown
Contributor

I would suggest adding a sentence like "This is likely caused by value={something} changing from undefined to a defined value".

@sophiebits

Copy link
Copy Markdown
Collaborator
  • The %s placeholder here is not the value type but rather the input type (checkbox, radio, etc). However I don’t think we need this info any more since we have robust component stacks in warnings. So let’s just remove that substitution and say “undefined value”.
  • You’ll need to update any tests that are verifying this warning message.
  • Other than that, this is a great improvement! Any chance you can make the above improvements? Then this can be merged.

@vcarl

vcarl commented Jan 2, 2020

Copy link
Copy Markdown
Contributor Author

Looks like this was upgraded to an error since I opened the PR. Fixing conflicts.

@codesandbox-ci

codesandbox-ci Bot commented Jan 2, 2020

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dbe2dcc:

Sandbox Source
cool-mountain-7k3dq Configuration

@sizebot

sizebot commented Jan 2, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against dbe2dcc

@sizebot

sizebot commented Jan 2, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against dbe2dcc

@vcarl

vcarl commented Jan 7, 2020

Copy link
Copy Markdown
Contributor Author

No rush on this, but anything else needed for it to land? cc @sophiebits @gaearon

@stale

stale Bot commented Apr 7, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale Bot added the Resolution: Stale Automatically closed due to inactivity label Apr 7, 2020
@vcarl vcarl closed this Apr 7, 2020
@vcarl
vcarl deleted the patch-1 branch April 7, 2020 15:57
@gaearon

gaearon commented Apr 7, 2020

Copy link
Copy Markdown
Collaborator

@vcarl Sorry, there's a huge backlog and things slip through. I wanted to merge this but now the ref is gone. :-(

@vcarl
vcarl restored the patch-1 branch April 7, 2020 20:45
@vcarl

vcarl commented Apr 7, 2020

Copy link
Copy Markdown
Contributor Author

I restored the branch, but am unsubscribing from the PR. If it lands, cool! But I'm moving on.

@gaearon gaearon reopened this Apr 7, 2020
@stale stale Bot removed the Resolution: Stale Automatically closed due to inactivity label Apr 7, 2020
@gaearon
gaearon merged commit 03de849 into react:master Apr 7, 2020
@gaearon

gaearon commented Apr 7, 2020

Copy link
Copy Markdown
Collaborator

Thanks!

This was referenced Mar 15, 2021
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* Make uncontrolled -> controlled warning clearer

* Update phrasing, mirror for opposite direction

* Remove unused substitution

* Update warning tests

* Literally got these backwards, womp womp

* Rerere-fix tests
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.

The warning for uncontrolled -> controlled inputs is confusing

6 participants