goveo / react-international-phone

☎️ International phone input component for React
https://react-international-phone.vercel.app/
MIT License
277 stars 54 forks source link

How to clear input on initial render? #178

Closed BrilliantDecision closed 5 months ago

BrilliantDecision commented 5 months ago

When input mounts, we see country code, for example +1. But I want to have an empty input on initial render We can clear input with ref, but hook stores the initial value until you use handlePhoneValueChange method

goveo commented 5 months ago

@BrilliantDecision Use the disableDialCodePrefill prop https://react-international-phone.vercel.app/docs/Usage/PhoneInput#disabledialcodeprefill