Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在表单中不显示null_Javascript_Reactjs - Fatal编程技术网

Javascript 如何在表单中不显示null

Javascript 如何在表单中不显示null,javascript,reactjs,Javascript,Reactjs,我有一张表格。当前,当没有电子邮件的用户提交电子邮件时,它会在电子邮件字段字符串中显示,文本为null。如何使此字段为空。这是电子邮件字段的代码 patientEmail: currentPatient.email ? currentPatient.email : null PatientMail:currentPatient.email?currentPatient.email:“ 只需将null替换为空字符串 将null替换为”…使用或运算符作为默认值patientEmail:curren

我有一张表格。当前,当没有电子邮件的用户提交电子邮件时,它会在电子邮件字段字符串中显示,文本为
null
。如何使此字段为空。这是电子邮件字段的代码

patientEmail: currentPatient.email ? currentPatient.email : null

PatientMail:currentPatient.email?currentPatient.email:“


只需将null替换为空字符串

null
替换为
…使用或运算符作为默认值
patientEmail:currentPatient.email | |?