Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: Functions are not valid as a React child. (React-native )

I am receiving the error: Warning: Functions are not valid as a React child.

I am writing a React Native application.

interface RegisterScreenProps {
  navigation: NavigationContainerRef;
}

const RegisterScreen: FunctionComponent<RegisterScreenProps> = ({
  navigation,
}: RegisterScreenProps) => {
  const { container, headerLogo, headerTitle, body } = styles;

  return (
    <SafeAreaView style={{ flex: 1 }}>
      <KeyboardAwareScrollView style={styles.container}>
        <View>
        <TextInput value={'afasfasdfdsfssddfsdfsffasf'} placeholder={'My Input'} />
        </View>
        
      </KeyboardAwareScrollView>
    </SafeAreaView>
  );
};

export default RegisterScreen;

I have tried many solutions but did not get success. When I remove KeyboardAwareScrollView this code works fine. i need KeyboardAwareScrollView for TextInput.

like image 885
Kashif Ahmed Avatar asked Sep 05 '25 16:09

Kashif Ahmed


1 Answers

This is an issue from react-native-keyboard-aware-scroll-view, fixed in this commit .

You need to upgrade your react-native-keyboard-aware-scroll-view version in package.json to a newer version (>= 0.9.2, preferably use the latest stable version).

like image 63
Rafael Tavares Avatar answered Sep 07 '25 18:09

Rafael Tavares