react-navigation icon indicating copy to clipboard operation
react-navigation copied to clipboard

The StackNavigator function name is deprecated, please use createStackNavigator instead

Open IamMasterWayne opened this issue 8 years ago • 10 comments

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:

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

IamMasterWayne avatar May 06 '18 08:05 IamMasterWayne

you installed v2 and this is accurate

brentvatne avatar May 06 '18 16:05 brentvatne

@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?

aaronromeo avatar May 07 '18 02:05 aaronromeo

Any V2 docs then?

MakhouT avatar May 07 '18 04:05 MakhouT

V2 docs: https://v2.reactnavigation.org/ A link+warning from the V1 page would be welcome.

jdelafon avatar May 07 '18 08:05 jdelafon

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 :)

eyalella avatar May 10 '18 10:05 eyalella

Solved the issue by using

import  { createStackNavigator }  from 'react-navigation';

Idimma avatar May 11 '18 11:05 Idimma

Thank u very much @Idimma 💯

tncho avatar Jun 09 '18 22:06 tncho

Thank you Idimma.

emmeiwhite avatar Sep 12 '18 15:09 emmeiwhite

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

praveennamdev avatar Feb 12 '19 14:02 praveennamdev

please give me code for drawer navigator i use expo latest version and i use latest nodjs use

praveennamdev avatar Feb 12 '19 14:02 praveennamdev