React-phone input error in formik while using handlechange
Rahulr2001 opened this issue · comments
class Createemp extends Component{
render(){
return(
{
({ handleSubmit, handleChange, values, errors }) =>
(
<form className="container" onSubmit={handleSubmit}>
<div >
<PhoneInput
name='phone'
country={'us'}
value={values.phone}
onChange={handleChange}
/>
<small >{errors.phone}</small>
</div>
<button
type='submit'
className="empcreate"
//onClick={this.createRestaurant}
//onClick={window.location.reload()}
><span className="text">Create</span></button>
</form>
)}
</Formik>
</div>
)
}
}
export default Createemp;
...value which i enter in the input is always empty..even i entered a mobile...the on change event didnt work for me to give the value to values.phone for my validation
onChange returns a value.
handleChange likely expects an event.
…On Wed, 16 Feb 2022 at 10:16, Rahulr2001 ***@***.***> wrote:
class Createemp extends Component{
render(){
return(
{
({ handleSubmit, handleChange, values, errors }) =>
(
<form className="container" onSubmit={handleSubmit}>
<div >
<PhoneInput
name='phone'
country={'us'}
value={values.phone}
onChange={handleChange}
/>
<small >{errors.phone}</small>
</div>
<button
type='submit'
className="empcreate"
//onClick={this.createRestaurant}
//onClick={window.location.reload()}
><span className="text">Create</span></button>
</form>
)}
</Formik>
</div>
)
}
}
export default Createemp;
...*value which i enter in the input is always empty..even i entered a
mobile...the on change event didnt work for me to give the value to
values.phone for my validation*
—
Reply to this email directly, view it on GitHub
<#400>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUP326RGHQWURR5EJ6RE3U3NFOHANCNFSM5OQXW2TA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
sir..how i change it to event in code.. iam stuck here...i have read all your comment in previous issues but..stuck on the code..that where to change...which code to add.. can u demonstrate me sir
How to change a value to an event? Strictly speaking, there’s no such way.
Google for “create change event from value” or something like that. Or use
another form library.
…On Wed, 16 Feb 2022 at 20:01, Rahulr2001 ***@***.***> wrote:
sir..how i change it to event in code.. iam stuck here...i have read all
your comment in previous issues but..stuck on the code..that where to
change...which code to add.. can u demonstrate me sir
—
Reply to this email directly, view it on GitHub
<#400 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUP32Z756Z2A3NNXWQCT3U3PJ6NANCNFSM5OQXW2TA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
#298 (comment)
Maybe that
…On Wed, 16 Feb 2022 at 23:49, Rahulr2001 ***@***.***> wrote:
Closed #400
<#400>.
—
Reply to this email directly, view it on GitHub
<#400 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUP34CYCW7PBG7TMXVZS3U3QEV3ANCNFSM5OQXW2TA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
<catamphetamine/react-phone-number-input/issue/400/issue_event/6085753713@
github.com>