2

I know I can do setOptions on the navigation object, but I can't seem to find the get version of it. How do I obtain that information, namely I want to know if headerLarge is enabled.

What I have done as a workaround for now is have a useEffect on the header component that stores the screenOptions data into a context object keyed by route key. With a return method that will remove it from the context when the header is unmounted.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

-1

You can set headerLarge using below code :

function MyStack() {
  return (
    <Stack.Navigator>
      <Stack.Screen
        name="Home"
        options={{
          headerLargeTitle: true,
        }}
        component={HomeScreen}
      />
    </Stack.Navigator>
  );
}

PS : headerLarge is only for iOS.

Iva
  • 2,447
  • 1
  • 18
  • 28
  • 1
    Doesn't answer my question. I am trying to get all the options though I am focused on one for my current situation. Also headerLargeTitle is only available for nativestacknavigator not stack navigator. – Archimedes Trajano Jul 22 '22 at 05:20