From 784b0167367c4bed8197cad835a41ebd68ce8a4b Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 3 May 2022 12:05:01 -0400 Subject: [PATCH] chore: evaluate `LoginView` (#4098) --- app/views/LoginView.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/LoginView.tsx b/app/views/LoginView.tsx index fcb548f25..7c948f637 100644 --- a/app/views/LoginView.tsx +++ b/app/views/LoginView.tsx @@ -1,6 +1,6 @@ import { dequal } from 'dequal'; import React from 'react'; -import { Alert, Keyboard, StyleSheet, Text, View } from 'react-native'; +import { Alert, Keyboard, StyleSheet, Text, View, TextInput as RNTextInput } from 'react-native'; import { connect } from 'react-redux'; import { loginRequest } from '../actions/login'; @@ -64,8 +64,13 @@ interface ILoginViewProps extends IBaseScreen { inviteLinkToken: string; } -class LoginView extends React.Component { - private passwordInput: any; +interface ILoginViewState { + user: string; + password: string; +} + +class LoginView extends React.Component { + private passwordInput: RNTextInput | null | undefined; static navigationOptions = ({ route, navigation }: ILoginViewProps) => ({ title: route?.params?.title ?? 'Rocket.Chat', @@ -160,7 +165,7 @@ class LoginView extends React.Component { returnKeyType='next' onChangeText={(value: string) => this.setState({ user: value })} onSubmitEditing={() => { - this.passwordInput.focus(); + this.passwordInput?.focus(); }} testID='login-view-email' textContentType='username'