patw0929 / react-intl-tel-input

Rewrite International Telephone Input in React.js. (Looking for maintainers, and PRs & contributors are also welcomed!)
https://patw0929.github.io/react-intl-tel-input/
MIT License
284 stars 220 forks source link

fix: avoid await async libphonenumber-js-utils import #350

Closed mcataford closed 1 year ago

mcataford commented 4 years ago

Description

:construction: WIP

This PR makes the async import of libphonenumber-js-utils (from initRequests) a blocking import, resolving the problem from #347 (and any RTL-related issue that has the async import not be ready in time for the test). The asynchronous import really seems to be causing trouble with test runners. Clients are probably safe because so many things are happening in the browser that the user can't see the delay between the async import start and resolution.

Since the component is inert until the validation logic is ready, which happens when the import is done, it might make sense to have this toggle a loading state of some kind.

This is still an experiment

Todo

Types of changes

Checklist: