【问题标题】:createAnimatedSwitchNavigator undefined is not a functioncreateAnimatedSwitchNavigator undefined 不是函数
【发布时间】:2019-10-16 17:10:29
【问题描述】:

我正在开发一个反应原生应用程序。在那个应用程序中,我正在尝试使用一个名为

的 NPM 包

createAnimatedSwitchNavigator

但是当我尝试运行程序时,我收到以下错误

undefined 不是函数(评估 '(0 _reactNavigationAnimatedSwitch.createAnimatedSwitchNavigator)')

下面是我的代码

注意:- 正常的 SwitchNavigator 可以正常使用此代码

            import {createAnimatedSwitchNavigator,
                createAppContainer} from 'react-navigation-animated-switch';

            import Login   from "./Login/Login";
            import SignUp  from './SignUp/SignUp';

            const Navigate = createAnimatedSwitchNavigator({
            Login:         {screen:Login},
            SignUp:        {screen:SignUp},
            },
            )

            export const AppContainer = createAppContainer(Navigate)

【问题讨论】:

    标签: android react-native npm undefined-function


    【解决方案1】:

    我使用以下方法修复了它

    import createAnimatedSwitchNavigator from 'react-navigation-animated-switch';
    import {createAppContainer } from 'react-navigation';
    

    【讨论】:

      猜你喜欢
      • 2020-10-12
      • 2015-10-29
      • 2015-06-05
      • 2015-06-12
      • 2015-10-16
      • 2013-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多