My React Native code:
import React, { Component } from \'react\';
import { AppRegistry, ActivityIndicator, StyleSheet, ListView,
Text, Button, TouchableH
for me, soved it by useNavigation() and useRoute():
For functional component:
import * as React from 'react';
import { Button } from 'react-native';
import { useNavigation } from '@react-navigation/native';
function MyBackButton() {
const navigation = useNavigation();
return (
For class component:
class MyText extends React.Component {
render() {
// Get it from props
const { route } = this.props;
}
}
// Wrap and export
export default function(props) {
const route = useRoute();
return ;
}