Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Header in functional component React Native

I'm setting up a navigation in react-native using only functional component. How do i remove the header on the Screen?

const AppScreen = ({ navigation }) => {

  //Desc => removing header
  AppScreen.navigationOptions = {
    header: null
  };

  return (
    <>
      <Text>LoGinScreen</Text>
    </>
  );
};

No error message is shown but the app renders with a header.

like image 918
Samuel Tengan Avatar asked Apr 07 '26 21:04

Samuel Tengan


1 Answers

You can remove header from functional component

 const AppScreen = ({ navigation }) => {
 return (
   <Text>LoginScreen</Text>
 );
};

by using this out side of your functional component.

AppScreen.navigationOptions = {
header: null
};
like image 126
Muhammad Shaheem Avatar answered Apr 10 '26 10:04

Muhammad Shaheem