"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.23k
stars
867
forks
source link
How to navigate to another page when click on text inside react-native-tab-view? #925
I am trying to navigate to navigate to another page when click on data inside the second tab. It gives "Undefined is not an object evaluating navigation.navigate". My first question is can we navigate to another page when inside the tabs? if yes how? if no any alternative solution?
import React, { useState, useEffect } from 'react';
import { View, FlatList, ScrollView, RefreshControl, StyleSheet, Dimensions } from 'react-native';
import { TabView, SceneMap } from 'react-native-tab-view';
import {
Button,
withTheme,
Appbar,
Divider,
List, Chip, Menu, Card, Paragraph, Title
} from 'react-native-paper';
import Icon from 'react-native-vector-icons/AntDesign';
import AsyncStorage from '@react-native-community/async-storage';
I am trying to navigate to navigate to another page when click on data inside the second tab. It gives "Undefined is not an object evaluating navigation.navigate". My first question is can we navigate to another page when inside the tabs? if yes how? if no any alternative solution?
import React, { useState, useEffect } from 'react'; import { View, FlatList, ScrollView, RefreshControl, StyleSheet, Dimensions } from 'react-native'; import { TabView, SceneMap } from 'react-native-tab-view'; import { Button, withTheme, Appbar, Divider, List, Chip, Menu, Card, Paragraph, Title } from 'react-native-paper'; import Icon from 'react-native-vector-icons/AntDesign'; import AsyncStorage from '@react-native-community/async-storage';
const requestedItems = [];
const Edit = () => { const [data, setData] = useState([{ 'name': 'abc', 'id': '1' }, { 'name': 'xyz', 'id': '2' }]); return (
) }
const Draft = () => { return (
) }
const initialLayout = { width: Dimensions.get('window').width };
const Requests = ({ navigation }) => { const [index, setIndex] = React.useState(0); const [routes] = React.useState([ { key: 'draft', title: 'Draft' }, { key: 'edit', title: 'Edit' }, ]);
const renderScene = ({ route }) => { switch (route.key) { case 'draft': return ;
case 'pending':
return ;
}
};
const _back = () => { navigation.goBack() }
const _navigateToEdit = () => { navigation.navigate('edit', { details: [], isEdit: false }) }
return ( <>