-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix #16 missing documentation: null/undefined as input value #35
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
Conversation
Deploy preview ready! Built with commit 5a084dd |
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! |
sorry for the inconvenience, I already registered |
No worries! Thanks for confirming. 😄 (Sorry for the awkwardness here. I'm still getting the new repo setup. Normally this comment is automated.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is subjective, but I think this content would be better as a subsection of docs/forms.html
(under the "Controlled Components" header) rather than a standalone page.
I think we could redirect /tips/controlled-input-null-value.html
(mentioned in #16) directly to this new subsection using the _redirects
file. I haven't tried this but I think we could do it with a new rule like so:
/tips/controlled-input-null-value.html /docs/forms.html#anchortaghere
(Where #anchortaghere matches whatever section header we use.)
permalink: docs/controlled-input-null-value.html | ||
--- | ||
|
||
Specifying the value prop on a [controlled component](/docs/forms.html) prevents the user from changing the input unless you desire so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably link to /docs/forms.html#controlled-components
|
||
You might have run into a problem where value is specified, but the input can still be changed without consent. In this case, you might have accidentally set value to undefined or null. | ||
|
||
For example, this code shows this phenomenon; after a second, the text becomes editable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical nit: There's a lot of unnecessary commas in this content. Maybe we could change it something like?
You might have encountered a situation where
value
is specified but an input is still editable. In this case you might have accidentally setvalue
toundefined
ornull
.
The following code demonstrates this. (The input becomes editable after a short delay.)
Thanks, I'll make the necessary changes. 👍 |
I noticed that this redirect rule |
It should, so long as the anchor tag actually matches one on the page 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing!
No description provided.