Improve quality of Typescript types (#10742)

This commit is contained in:
Michael Telatynski 2023-05-05 09:11:14 +01:00 committed by GitHub
parent 542bf68c63
commit a4f0b80692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 74 additions and 75 deletions

View file

@ -67,9 +67,9 @@ const enum LoginField {
* The email/username/phone fields are fully-controlled, the password field is not.
*/
export default class PasswordLogin extends React.PureComponent<IProps, IState> {
private [LoginField.Email]: Field | null;
private [LoginField.Phone]: Field | null;
private [LoginField.MatrixId]: Field | null;
private [LoginField.Email]: Field | null = null;
private [LoginField.Phone]: Field | null = null;
private [LoginField.MatrixId]: Field | null = null;
public static defaultProps = {
onUsernameChanged: function () {},

View file

@ -95,11 +95,11 @@ interface IState {
* A pure UI component which displays a registration form.
*/
export default class RegistrationForm extends React.PureComponent<IProps, IState> {
private [RegistrationField.Email]: Field | null;
private [RegistrationField.Password]: Field | null;
private [RegistrationField.PasswordConfirm]: Field | null;
private [RegistrationField.Username]: Field | null;
private [RegistrationField.PhoneNumber]: Field | null;
private [RegistrationField.Email]: Field | null = null;
private [RegistrationField.Password]: Field | null = null;
private [RegistrationField.PasswordConfirm]: Field | null = null;
private [RegistrationField.Username]: Field | null = null;
private [RegistrationField.PhoneNumber]: Field | null = null;
public static defaultProps = {
onValidationChange: logger.error,