Input loses focus on start typing in THEME

I am trying to develop a react-native app for that I design a custom theme component and include my screen in the theme using this.props.child. The problem is that the input field in the screen loses focus and the keyboard gets dismissed after each character I type, as in onChange I am updating state variables which may re-render the whole theme.

I have tried many solutions given on Github like a passing unique key to the input field, but they don’t work.

This is how my theme component looks like:

import Header from './header'
import footer from './footer'

export default class Theme extends Component {

    render() {
        //------this is my header component----
        <Header/>
        <View>
        //------this is my Body  in which i include my sceen content----
        {this.props.children}
        </View>

         //------this is my footer component----
        <footer/>
    }
}

Here is my screen with the input field:

import Theme from "../../components/Theme";
import { Input, Button } from "react-native-elements";

export default  class ChangePassword extends Component {

    constructor(props) {

    super(props);
    this.state = {

        inputs:{
            old_password : {value:null, errorMesssage:""}

        }
    }
}


 setValues = async (key, value) => {

    let { inputs } = this.state;

      inputs[key]["value"] = value;
      inputs[key]["errorMessage"] = "";


      await this.setState({ inputs });


  }

    render(){

    let {inputs}=this.state;
    return(
            <Theme>

            <Input
                    key="Current_password"
                    ref="Current_password"
                    containerStyle={styles.containerStyle}
                    inputContainerStyle={styles.inputContainer}
                    label="Current password"
                    value={inputs.old_password.value}
                    errorMessage={inputs.old_password.errorMessage}
                    errorStyle={styles.inputErrorStyle}
                    secureTextEntry={true}
                    autoFocus={true}
                    onChangeText={(val) => {
                    this.setValues("old_password", val);
                    }}

                />


            </Theme>
    )

    }

}

Please help me to solve the issue, I want onChangeText to update my state variable without dismissing the keyboard.

Source: React natvie