Error trying to use inputComponent
See original GitHub issueHi,
I’m trying to use the property inputComponent
with the Input
component from material-ui (https://material-ui.com/api/input/) but when I try to type something I get the error Uncaught TypeError: text.search is not a function
and I’m not sure what is the problem. The documentation of this property is a little bit simple and I couldn’t understand what else I would need to do.
<PhoneInput
name={name}
country={defaultCountry}
dictionary={dictionary}
international={international}
value={value}
limitMaxLength={limitMaxLength}
onChange={phone => this.handleOnChange(name, phone)}
inputComponent={Input}
// inputComponent={<Input />}
// inputComponent={props => <Input {...props} />}
/>
Issue Analytics
- State:
- Created 5 years ago
- Comments:32 (16 by maintainers)
Top Results From Across the Web
I am having errors while using input component in my next.js ...
I am using stripe payment in my next.js project. I am having a material ui textfield like this import StripeInput from '.
Read more >tJMS input component connection error. - Talend Community
Hi,. I m trying to use tjms input component and gave all the requried component settings.. But M still getting this error.
Read more >Input Components - React-admin - Marmelab
Which Input Component to Use? ... may “jump” visually when the input contains an error, as the error message will appear below the...
Read more >React Text Field component - Material UI - MUI
The error prop toggles the error state. The helperText prop can then be ... The select prop makes the text field use the...
Read more >How to create reusable form components with React Hook ...
You might want to reuse the same validation logic and error styling ... We also want to replace the <Input> component we were...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NevenLiang, did you ever develop this further?
It looks like if you supply your own
inputComponent
, then your input component is responsible for formatting the phone number value, too. Did you happen to add that feature to yours?I was hoping that using a custom
inputComponent
would only change which input was used (mostly to make the look consistent with the other inputs in the form) but everything else would work the same.Automatic formatting of the phone number seems like something react-phone-number-input could/should do for you regardless of which
inputComponent
you happen to be using. I wish that functionality were exposed buried within InputBasic. (I wonder if that was necessary due to differences between InputBasic and InputSmart?)But in the code
onChange(event.target.value)
,onChange
is theprops.onChange
from<PhoneInput/>
.Is the description in document not very accurate?
Using the parameter passed to
props.onChange
from<PhoneInput/>
must be astring
, it may be more accurate.I suggest that you add some example like this, to the github page of this project.