簡體   English   中英

我如何在反應中將名字/姓氏更改為名字/姓氏? 問題是它來自后端

[英]how can i change firstname/lastname to firstName/lastName in react? the problem is that it comes from the backend

后端示例 { "email": "string", "password": "string", "firstName" : "string", "lastName" : "string" }

我正在使用文本輸入:

     <TextInput 
           name='firstname'
           type='text'
           label='First Name'  
           placeholder='John'/>

我的錯誤是在 formik 中,我寫錯了值名稱

  <Formik 
    initialValues={{email: "", password: "", firstname: "", lastname: "", 
     passwordConfirm: ""}}
   >

**應該 **

<Formik 
        initialValues={
              {email: "", 
               password: "", 
             **firstName: "",** 
             **lastName:""**, 
         passwordConfirm: ""}}
       >

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM