eirslett / frontend-maven-plugin

"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

Closed prajna-h closed 4 years ago

prajna-h commented 4 years ago

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 (

index.toString()} ItemSeparatorComponent={() => } renderItem={({ item }) => ( navigation.navigate('edit', { details: item, isEdit: false })} titleStyle={{ textDecorationLine: 'underline', color: 'blue' }} /> )} />

) }

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 ( <>

()} onPress={_back} /> ()} onPress={_navigateToEdit} /> ); } const styles = StyleSheet.create({ scene: { flex: 1, }, }); export default Test;
holgergp commented 4 years ago

This does not seem to be related to the frontend-maven-plugin.

eirslett commented 4 years ago

Yes, this issue is filed in the wrong GitHub project.