The StackNavigator function name is deprecated, please use createStackNavigator instead
The issue tracker is reserved for bug reports only.
If you have a question, feature request, or an idea for improving the library or its related tools, please try one of the following resources:
- Read the documentation
- Post an issue to the website repository if you'd like to see a documentation change
- Post a feature request to Canny
- Write a RFC if you have ideas for how to implement a feature request
- Get help on Discord chat (#react-navigation on Reactiflux) or on StackOverflow
- Search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue.
Bugs with react-navigation must be reproducible without any external libraries that operate on it. This means that if you are attempting to use Redux or MobX with it and you think you have found a bug, you must be able to reproduce it without Redux or MobX in this report. Redux related issues belong in react-navigation-redux-helpers, and we do not have any first-class integration with MobX at the moment.
Current Behavior
- What code are you running and what is happening?
- Include a screenshot if it makes sense.
Expected Behavior
- What do you expect should be happening?
- Include a screenshot if it makes sense.
How to reproduce
- You must provide a way to reproduce the problem. If you are having an issue with your machine or build tools, the issue belongs on another repoistory as that is outside of the scope of Rect Navigation.
- Either re-create the bug on Snack or link to a GitHub repository with code that reproduces the bug.
- Explain how to run the example app and any steps that we need to take to reproduce the issue from the example app.
Your Environment
| software | version |
|---|---|
| react-navigation | |
| react-native | |
| node | |
| npm or yarn |
you installed v2 and this is accurate
@brentvatne I've also run into this issue, and in my case it stems from the docs https://reactnavigation.org/docs/hello-react-navigation.html#creating-a-stacknavigator. Are there docs outlining the v2 API? Or is there a better way to go about this?
Any V2 docs then?
V2 docs: https://v2.reactnavigation.org/ A link+warning from the V1 page would be welcome.
For me the problem was I still saw the warning even after replacing all the navigators
The StackNavigator function name is deprecated, please use createStackNavigator instead
I was able to solve it tough... The problem was this code which was loading the deprecated navigators as well
import * as reactNavigation from "react-navigation";
Simply changed to
import { x } from "react-navigation"
And issue solved :)
Solved the issue by using
import { createStackNavigator } from 'react-navigation';
Thank u very much @Idimma 💯
Thank you Idimma.
please this problem not solve when i use drawernavigator
my code is import React ,{ Component }from 'react'; import { StyleSheet, Text, View,Button } from 'react-native'; import { Constants } from 'expo'; import {DrawerNavigatior} from 'react-navigation' import Home from './Home' import Setting from './Setting'
const navigation= DrawerNavigatior({ Home:{ screen:Home },Setting:{ screen:Setting } })
export default navigation
error is reactnavigation.drawernavigator not function
please give me code for drawer navigator i use expo latest version and i use latest nodjs use