[英]how can i change firstname/lastname to firstName/lastName in react? the problem is that it comes from the backend
the back-end example { "email": "string", "password": "string", "firstName" : "string", "lastName" : "string" }后端示例 { "email": "string", "password": "string", "firstName" : "string", "lastName" : "string" }
i'm using TextInput:我正在使用文本输入:
<TextInput
name='firstname'
type='text'
label='First Name'
placeholder='John'/>
my mistake was in formik, i writes value names wrong我的错误是在 formik 中,我写错了值名称
<Formik
initialValues={{email: "", password: "", firstname: "", lastname: "",
passwordConfirm: ""}}
>
**should be ** **应该 **
<Formik
initialValues={
{email: "",
password: "",
**firstName: "",**
**lastName:""**,
passwordConfirm: ""}}
>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.