Sfoglia il codice sorgente

Fixed type errors!

Taichi Masuyama 3 anni fa
parent
commit
31fe2fe327
1 ha cambiato i file con 4 aggiunte e 11 eliminazioni
  1. 4 11
      packages/app/src/components/InstallerForm.tsx

+ 4 - 11
packages/app/src/components/InstallerForm.tsx

@@ -5,13 +5,7 @@ import { useTranslation, i18n } from 'next-i18next';
 
 
 import { i18n as i18nConfig } from '^/config/next-i18next.config';
 import { i18n as i18nConfig } from '^/config/next-i18next.config';
 
 
-type Props = {
-  userName: string,
-  name: string,
-  email: string,
-};
-
-const InstallerForm = (props: Props): JSX.Element => {
+const InstallerForm = memo((): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const [isValidUserName, setValidUserName] = useState(true);
   const [isValidUserName, setValidUserName] = useState(true);
@@ -114,7 +108,6 @@ const InstallerForm = (props: Props): JSX.Element => {
               className="form-control"
               className="form-control"
               placeholder={t('User ID')}
               placeholder={t('User ID')}
               name="registerForm[username]"
               name="registerForm[username]"
-              defaultValue={props.userName}
               // onBlur={checkUserName} // need not to check username before installation -- 2020.07.24 Yuki Takei
               // onBlur={checkUserName} // need not to check username before installation -- 2020.07.24 Yuki Takei
               required
               required
             />
             />
@@ -131,7 +124,6 @@ const InstallerForm = (props: Props): JSX.Element => {
               className="form-control"
               className="form-control"
               placeholder={t('Name')}
               placeholder={t('Name')}
               name="registerForm[name]"
               name="registerForm[name]"
-              defaultValue={props.name}
               required
               required
             />
             />
           </div>
           </div>
@@ -146,7 +138,6 @@ const InstallerForm = (props: Props): JSX.Element => {
               className="form-control"
               className="form-control"
               placeholder={t('Email')}
               placeholder={t('Email')}
               name="registerForm[email]"
               name="registerForm[email]"
-              defaultValue={props.email}
               required
               required
             />
             />
           </div>
           </div>
@@ -188,6 +179,8 @@ const InstallerForm = (props: Props): JSX.Element => {
       </div>
       </div>
     </div>
     </div>
   );
   );
-};
+});
+
+InstallerForm.displayName = 'InstallerForm';
 
 
 export default InstallerForm;
 export default InstallerForm;