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

@raunofreiberg raunofreiberg commented Aug 10, 2018

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
Member

@gaearon gaearon left a comment

Nits

Loading

@@ -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
Member

@gaearon gaearon Aug 10, 2018

Choose a reason for hiding this comment

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

“a textarea”

Loading

@@ -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
Member

@gaearon gaearon Aug 10, 2018

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?

Loading

@raunofreiberg
Copy link
Contributor Author

@raunofreiberg raunofreiberg commented Aug 10, 2018

Loading

@gaearon gaearon merged commit 47e217a into facebook:master Aug 13, 2018
1 check passed
Loading
@gaearon
Copy link
Member

@gaearon gaearon commented Aug 13, 2018

Thanks

Loading

@raunofreiberg raunofreiberg deleted the fiber-text-area-component-name branch Aug 14, 2018
TejasQ pushed a commit to TejasQ/react that referenced this issue Aug 26, 2018
…ok#13361)

* Provide component reference if possible in ReactDOMFiberTextarea.js warning

* Nits
@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants