jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers. React and Vue components also included.
https://intl-tel-input.com
MIT License
7.69k stars 1.95k forks source link

React version of intl-tel-input throws an error when imported #1836

Closed thanhboo closed 1 month ago

thanhboo commented 1 month ago

Plugin version

e.g. v24.5.1 (please try latest version)

Steps to reproduce

  1. Run yarn add intl-tel-input
  2. Add line: import IntlTelInput from 'intl-tel-input/reactWithUtils'; => It throw error Cannot find module 'intl-tel-input/reactWithUtils' or its corresponding type declarations.
  3. Try to add other line: import IntlTelInput from 'intl-tel-input/intlTelInputWithUtils' => It throw 'IntlTelInput' cannot be used as a JSX component.

Expected behaviour

Expect to import the react version of intl-tel-input as IntlTelInput

Initialisation options

I'm currently using reactWithUtils

jackocnr commented 1 month ago

Can you clarify which version of the plugin you're using?

And can you share more about your setup: are you using eslint? typescript? etc, which versions are you using? And can you share your config files for them as well?

Which IDE are you using? What exactly is throwing that error, and is there any more information provided?

What bundler/version are you using etc?

thanhboo commented 1 month ago

Currently i'm using the environment like below:

The problem is when i'm using import IntlTelInput from 'intl-tel-input/reactWithUtils'; => It throw error Cannot find module 'intl-tel-input/reactWithUtils' or its corresponding type declarations.

jackocnr commented 1 month ago

Thanks.

Which version of Typescript?

And please include your tsconfig as well.

jackocnr commented 1 month ago

Closing due to inactivity.