'React Navigation 6.x - How to trigger navigation in parent navigator, and how to trigger method in child component?

I have a React Native app with a nested navigator structure like so:

StackA
  -- Tabs
    -- StackB
  1. From StackB, is there a cleaner way to trigger a navigation on StackA than navigation.getParent().getParent().navigate(...)? (eg: From within the News component, navigate StackA -> Article)
  2. From StackA or Tab, how could I trigger a method on a screen within StackB? (eg: When pressing the Home tab button, trigger a method inside the News component)

My code looks something like:

function App () {
  return (
    <NavigationContainer>
      <Stack.Navigator> {/* StackA */}
        <Stack.Screen name="home" component={Tabs} /> /* Tab */
        <Stack.Screen name="article" component={Article} />
      </Stack.Navigator>
    </NavigationContainer>
  )
}

function Tabs () {
  return(
    <Tab.Navigator>
      <Tab.screen name="home" component={Home} />
      <Tab.screen name="search" component={Search} />
    </Tab.Navigator>
  )
}

function Home () {
  return(
    <Stack.Navigator> /* StackB */
      <Stack.screen name="news" component={News} />
      <Stack.screen name="archive" component={Archive} />
    </Stack.Navigator>
  )
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source