Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

274
Views
React-Native touchable Opacity not work in native-stack

i'm studying about React-Native and have a problem. touchableOpacity Tag doesn't work in native-stack.

my code is
Stack.js

    import React from "react";
    import { createNativeStackNavigator } from "@react-navigation/native-stack";
    import { Text, View, TouchableOpacity, TouchableNativeFeedback } from "react-native";

    const ScreenOne = ({ navigation: { navigate } }) => (
      // <TouchableOpacity onPress={(navigation) => navigate("Two")}>
      // add this code to check but didn't response
      <TouchableOpacity onPress={()=>alert('test')}>
        <Text>go to two</Text>
      </TouchableOpacity>
    );
    const ScreenTwo = ({ navigation: { navigate } }) => (
      <TouchableOpacity onPress={() => navigate("Three")}>
        <Text>go to three</Text>
      </TouchableOpacity>
    );
    const ScreenThree = ({ navigation: { setOptions } }) => (
      <TouchableOpacity onPress={() => setOptions({ title: "Hello!" })}>
        <Text>Change title</Text>
      </TouchableOpacity>
    );

    const NativeStack = createNativeStackNavigator();

    const Stack = () => (
      <NativeStack.Navigator>
        <NativeStack.Screen name="One" component={ScreenOne} />
        <NativeStack.Screen name="Two" component={ScreenTwo} />
        <NativeStack.Screen name="Three" component={ScreenThree} />
      </NativeStack.Navigator>
    );

    export default Stack;

========================================================================
App.js

import AppLoading from 'expo-app-loading';
import * as React from 'react';
import * as Font from 'expo-font';
import { Text, Image } from 'react-native';
import { Asset, useAssets } from 'expo-asset';
import {Ionicons} from '@expo/vector-icons'
import { NavigationContainer } from '@react-navigation/native';
import Tabs from './navigation/Tabs';
import Stack from "./navigation/Stack";




export default function App() {

  // assets 나 loaded가 준비되지 않았다면 
  if(!assets || !loaded) {
    return <AppLoading></AppLoading>;
  }

  return (
    <NavigationContainer>
      {/* <Tabs></Tabs> */}
      <Stack></Stack>
    </NavigationContainer>
  );
}

there's no error message. and i want to what's wrong with my files.

thankyou for reading my problem

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!