反应导航TypeError:undefined不是函数

时间:2017-11-01 13:57:43

标签: react-native react-navigation

我正在尝试将反应导航实施到我的应用程序中,但是只要我从react-navigation网站(链接:https://reactnavigation.org/docs/intro/basic-app)启动一个简单的示例应用程序,它就会失败并出现此错误:

TypeError: undefined is not a function (evaluating 'arr[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']()')

This error is located at:
    in SafeView (at withOrientation.js:50)
    in withOrientation (at Header.js:315)
    in Header (at withOrientation.js:50)
    in withOrientation (at CardStack.js:170)
    in RCTView (at View.js:113)
    in View (at CardStack.js:397)
    in RCTView (at View.js:113)
    in View (at createAnimatedComponent.js:134)
    in AnimatedComponent (at Card.js:26)
    in Card (at PointerEventsContainer.js:55)
    in Container (at CardStack.js:440)
    in RCTView (at View.js:113)
    in View (at CardStack.js:370)
    in RCTView (at View.js:113)
    in View (at CardStack.js:369)
    in CardStack (at CardStackTransitioner.js:103)
    in RCTView (at View.js:113)
    in View (at Transitioner.js:187)
    in Transitioner (at CardStackTransitioner.js:55)
    in CardStackTransitioner (at StackNavigator.js:48)
    in Unknown (at createNavigator.js:48)
    in Navigator (at createNavigationContainer.js:205)
    in NavigationContainer (at renderApplication.js:35)
    in RCTView (at View.js:113)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:113)
    in View (at AppContainer.js:126)
    in AppContainer (at renderApplication.js:34)
sliceIterator

<unknown>

<unknown>
    SafeAreaView.js:190:31
_getSafeAreaStyle
    SafeAreaView.js:164:38
render
    SafeAreaView.js:95:26
proxiedMethod
    createPrototypeProxy.js:44:35
finishClassComponent
    ReactNativeFiber-dev.js:1721:102
updateClassComponent
    ReactNativeFiber-dev.js:1713:33
beginWork
    ReactNativeFiber-dev.js:1833:44
performUnitOfWork
    ReactNativeFiber-dev.js:2569:33
workLoop
    ReactNativeFiber-dev.js:2595:141
_invokeGuardedCallback
    ReactNativeFiber-dev.js:75:23
invokeGuardedCallback
    ReactNativeFiber-dev.js:49:40
performWork
    ReactNativeFiber-dev.js:2634:41
scheduleUpdateImpl
    ReactNativeFiber-dev.js:2768:101
scheduleUpdate
    ReactNativeFiber-dev.js:2751:38
scheduleTopLevelUpdate
    ReactNativeFiber-dev.js:3048:91
updateContainer
    ReactNativeFiber-dev.js:3059:39
render
    ReactNativeFiber-dev.js:4483:53
renderApplication
    renderApplication.js:34:4
run
    AppRegistry.js:117:10
runApplication
    AppRegistry.js:191:26
__callFunction
    MessageQueue.js:306:47
<unknown>
    MessageQueue.js:108:26
__guard
    MessageQueue.js:269:6
callFunctionReturnFlushedQueue
    MessageQueue.js:107:17

这是我的代码

import React from 'react';
import {
  AppRegistry,
  Text,
} from 'react-native';
import { StackNavigator } from 'react-navigation';

class HomeScreen extends React.Component {
  static navigationOptions = {
    title: 'Welcome',
  };
  render() {
    return <Text>Hello, Navigation!</Text>;
  }
}

export const SimpleApp = StackNavigator({
  Home: { screen: HomeScreen },
});

AppRegistry.registerComponent('navigation', () => SimpleApp);

我查看了其他查询,但似乎每个人都遇到导航功能问题,我甚至不打电话导航我只想用导航启动应用程序。 你能帮我么?提前谢谢你:)

解决!!!如果您遇到同样的问题,请查看此github帖子https://github.com/react-community/react-navigation/issues/2853

0 个答案:

没有答案