Mass
Mass

Reputation: 31

react navigation problem with CreateAppContainer or createStackNavigator

hello everyone i write some application in react for apply what i have learned before, and i want to use react navigation for manage the screen an vue and my version of react is upper than 3, so i must use createAppContainer for the render but when i actualise the appli i have a header of nav bar but she dont have title. if some one can explaine me my error in this code. thanks

My snack in expo: https://snack.expo.io/@tadix/textexercicev2

exemple of screen : https://pasteboard.co/Isg9q3k.png

import {createStackNavigator,createAppContainer} from "react-navigation"

import Search from '../components/Search'

const SearchStackNavgator = createStackNavigator({
  Search:{
    screen:Search,
    navigationOption:{
      title: "Rechercher"
    }
  }
})


const AppsNavigator = createAppContainer(SearchStackNavgator);

export default AppsNavigator

Upvotes: 0

Views: 352

Answers (1)

CampbellMG
CampbellMG

Reputation: 2220

Just a typo, you're missing an 's' after navigationOption. It should look like this:

const SearchStackNavgator = createStackNavigator({
  Search:{
    screen:Search,
    navigationOptions:{
      title: "Rechercher"
    }
  }
})

Upvotes: 2

Related Questions