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

Provide component reference in ReactDOMFiberTextarea warnings #13361

Merged
merged 2 commits into from
Aug 13, 2018
Merged

Provide component reference in ReactDOMFiberTextarea warnings #13361

merged 2 commits into from
Aug 13, 2018

Conversation

raunofreiberg
Copy link
Contributor

I noticed that ReactDOMFiberInput.js provides a reference to the component, if possible. Why not do the same for ReactDOMFiberTextarea.js as well :-)?

@raunofreiberg raunofreiberg changed the title Provide component reference if possible in ReactDOMFiberTextarea.js w… Provide component reference in ReactDOMFiberTextarea warnings Aug 10, 2018
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Nits

@@ -70,11 +71,13 @@ export function initWrapperState(element: Element, props: Object) {
) {
warning(
false,
'Textarea elements must be either controlled or uncontrolled ' +
'%s contains an textarea with both value and defaultValue props. ' +
Copy link
Collaborator

Choose a reason for hiding this comment

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

“a textarea”

@@ -404,7 +404,8 @@ describe('ReactDOMTextarea', () => {
<textarea value="foo" defaultValue="bar" readOnly={true} />,
),
).toWarnDev(
'Textarea elements must be either controlled or uncontrolled ' +
'A component contains an textarea with both value and defaultValue props. ' +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let’s change the test to have an owner?

@raunofreiberg
Copy link
Contributor Author

@gaearon gaearon merged commit 47e217a into facebook:master Aug 13, 2018
@gaearon
Copy link
Collaborator

gaearon commented Aug 13, 2018

Thanks

@raunofreiberg raunofreiberg deleted the fiber-text-area-component-name branch August 14, 2018 08:07
@gaearon gaearon mentioned this pull request Sep 5, 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.

3 participants