Comments (10)
I'm sorry but I still don't see this working. In README.md file you're using ReactPhoneInput component, in the demo you've linked - PhoneInput. When I'm trying to use any of them I get the following error:
Property 'component' does not exist on type 'IntrinsicAttributes & PhoneInputProps & { children?: ReactNode; }'.
from react-phone-input-mui.
@krisko4 I'm not using the material-ui TextField API implementation. I have made changes to react-phone-input-2 so that it allows the input component as a prop.
Regarding typescript, I will change the type definitions and release a new version. I can see the countries dropdown while using MaterialUI v5. I will try to test it in typescript and update you.
You can see in the demo I'm using MaterialUI v5 and it works well
from react-phone-input-mui.
Thank you for your reply. I am looking forward to seeing a typescript update 👍🏻
from react-phone-input-mui.
Hi, @krisko4 I tried with typescript everything works fine with typescript as well. I have released a 2.17.3 version with type definitions.
Here is the example.
from react-phone-input-mui.
Property 'component' does not exist on type 'IntrinsicAttributes & PhoneInputProps & { children?: ReactNode; }'.
Yeah, this is a warning and you can ignore that type error. Some styles are misaligned too I will try to fix those. You can override those until I fix those.
Here is a full setup of the working typescript example. https://github.com/harish50/material-ui-phone-input-typescript
from react-phone-input-mui.
@krisko4 I have published the new version with the correct types. Please let me know if you still see the error.
from react-phone-input-mui.
The component property error is now gone, however it seems that PhoneInput doesn't accept any props other than component now, for example style property. Moreover, importing:
import "react-phone-input-material-ui/lib/style.css";
breaks the alignments.
So far I have used your solution just to take advantage of the masked input, without importing styles. Which means I have no access to country selector.
Your update has forced me to add some additional @ts-ignore marks to field properties.
from react-phone-input-mui.
Hey, @krisko4 I was busy with some home chores and had no time to look into it. Is it possible for you to contribute to this issue as I don't know much about package types?
from react-phone-input-mui.
@harish-everest Can I modify country flags image according to my style?
from react-phone-input-mui.
@imskr You can clone and modify according to your style in your repo.
from react-phone-input-mui.
Related Issues (16)
- not working HOT 2
- Support for @mui v5 HOT 4
- Issue with label HOT 6
- Dropdown and flags menu style error HOT 6
- Not working with MUI v4? HOT 1
- Vite react issue #130 HOT 3
- React 18 in peer-dependencies and use new API HOT 1
- Flag dropdown not shown HOT 4
- Problem with some country formats HOT 1
- dark mode HOT 1
- May crash if double-clicking label HOT 1
- `label` prop not listed in index.d.ts, instead being called `specialLabel` HOT 1
- defaultCountry is no longer an attribute in index.d.ts
- Phone number not visible after using Safari auto fill with countryCodeEditable as false
- Is this repo still maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-phone-input-mui.