I have a leaderboard which calls a component and passes it data to it like so:
_renderItem =({item}) => (
The useNavigation hook was introduced in v5:
import * as React from 'react';
import { Button } from 'react-native';
import { useNavigation } from '@react-navigation/native';
export function ChildComponent() => {
const navigation = useNavigation();
return (
Docs: https://reactnavigation.org/docs/use-navigation