For U.S. phone numbers this works perfectly fine and format them. As I step through the code, I see that it's executing fine but just not formatting numbers from other countries. I tried Germany and United Kingdom and all I get is the same numbers as I entered them without any formatting.
I also double-checked to see if I'm passing the correct country ID's. For Germany, I'm passing "de" and for United Kingdom, "gb". As you'll see in the code above, I'm also making sure that country codes are all upper case.
I created a wrapper function in my React app that exposes all the functions in this library.
The function that handles as-you-type looks like this:
For U.S. phone numbers this works perfectly fine and format them. As I step through the code, I see that it's executing fine but just not formatting numbers from other countries. I tried Germany and United Kingdom and all I get is the same numbers as I entered them without any formatting.
I also double-checked to see if I'm passing the correct country ID's. For Germany, I'm passing "de" and for United Kingdom, "gb". As you'll see in the code above, I'm also making sure that country codes are all upper case.
Any idea what may be the issue here?