Material-ui: Warning using inputComponent

Created on 17 Jan 2019  路  4Comments  路  Source: mui-org/material-ui


I have this warning generated:

Warning: Material-UI: you have provided a `inputComponent` to the input component
that does not correctly handle the `inputRef` property.
Make sure the `inputRef` property is called with a HTMLInputElement.

which also come from the docs... see https://material-ui.com/demos/text-fields/ on codesanbox

  • [ ] This is not a v0.x issue.
  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

No warning

TextField incomplete

Most helpful comment

@eps1lon the one form here https://material-ui.com/demos/text-fields/#formatted-inputs
oh I cant reproduce it any more, looks like I used an outtdated version of mui

```
ref={ref => {
inputRef(ref ? ref.inputElement : null);
}}
````

All 4 comments

Which specific demo is producing that error message?

@stunaz This warning was introduced in #13934 to fix one of the TextField examples.

@eps1lon the one form here https://material-ui.com/demos/text-fields/#formatted-inputs
oh I cant reproduce it any more, looks like I used an outtdated version of mui

```
ref={ref => {
inputRef(ref ? ref.inputElement : null);
}}
````

Just try it:
ref={(ref) => inputRef(ReactDOM.findDOMNode(ref))}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

sys13 picture sys13  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

rbozan picture rbozan  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments