Giter Site home page Giter Site logo

Comments (10)

krisko4 avatar krisko4 commented on July 21, 2024 2

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.

harish-everest avatar harish-everest commented on July 21, 2024

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

krisko4 avatar krisko4 commented on July 21, 2024

Thank you for your reply. I am looking forward to seeing a typescript update 👍🏻

from react-phone-input-mui.

harish-everest avatar harish-everest commented on July 21, 2024

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.
Screenshot 2022-02-28 at 6 35 35 PM

from react-phone-input-mui.

harish-everest avatar harish-everest commented on July 21, 2024

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.

harish-everest avatar harish-everest commented on July 21, 2024

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

krisko4 avatar krisko4 commented on July 21, 2024

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.
image
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.
image
Your update has forced me to add some additional @ts-ignore marks to field properties.

from react-phone-input-mui.

harish-everest avatar harish-everest commented on July 21, 2024

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.

imskr avatar imskr commented on July 21, 2024

@harish-everest Can I modify country flags image according to my style?

from react-phone-input-mui.

harish-everest avatar harish-everest commented on July 21, 2024

@imskr You can clone and modify according to your style in your repo.

from react-phone-input-mui.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.