3

I tried using ReactButton, but the onPress function doesn't run on click. All posts found on google are about not writing an arrow function in onPress, but that's not my mistake.

I don't know what it could be anymore, the function is not executed. I put a console.log inside to see if it appeared when clicking and nothing.

import * as React from 'react';
import { Text, StyleSheet, View, TextInput, ScrollView, Button } from 'react-native'
import { RectButton } from 'react-native-gesture-handler';

const SignIn = ({ navigation }) => {
  return (
    <ScrollView style={styles.scrollView}>
      <Text style={styles.PageName}>SignIn</Text>
      <View style={styles.form}>
        <TextInput
          placeholder="Email"
          style={styles.input}
          onChangeText={() => { }}
        />
        <TextInput
          placeholder="Password"
          style={styles.input}
          onChangeText={() => { }}
        />

        <RectButton
          style={styles.RectButton}
          onPress={ () => navigation.navigate('Home') }
        >
          <View style={styles.button}>
            <Text style={{ color: 'white' }}>SignIn</Text>
          </View>
        </RectButton>

        <Text onPress={() => navigation.navigate('SignUp')}>Never SignUp? SignUp, click here.</Text>
      </View>
    </ScrollView>
  );
};

0 Answers0