You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue where the default value of the PhoneInput component is not displayed when the page is initially loaded. The component does not recognize the default value on the first render.
Steps to Reproduce:
Set a default value for the PhoneInput using the value prop.
Load the page and observe that the default value is not displayed in the input field.
Expected Behavior:
The PhoneInput should display the default value when the page is first loaded.
Actual Behavior:
The input field remains empty on the initial load, but the value appears after the hot reload.
Code Example:
<PhoneInput
country="bj"
value="+22996669509" // Default phone number
countryCodeEditable={false}
/>
I've tried multiple ways to set the default value, including using useState, but the behavior is consistent across approaches. It seems related to how the component initializes the value on the first render.
The text was updated successfully, but these errors were encountered:
Description:
I am encountering an issue where the default value of the PhoneInput component is not displayed when the page is initially loaded. The component does not recognize the default value on the first render.
Steps to Reproduce:
Expected Behavior:
The PhoneInput should display the default value when the page is first loaded.
Actual Behavior:
The input field remains empty on the initial load, but the value appears after the hot reload.
Code Example:
Environment:
react-phone-input-2 version: ^2.15.1
React version: ^18.3.1
Additional Information:
I've tried multiple ways to set the default value, including using useState, but the behavior is consistent across approaches. It seems related to how the component initializes the value on the first render.
The text was updated successfully, but these errors were encountered: