مشکل کانفیگ redux و react navigation

- 5 روز پیش
توسط Mohamad reza golbaba آپدیت شد
Mohamad reza golbaba ( 1810 تجربه )
3 هفته پیش

سلام دوستان
من با redux و ٍreact navigation یه اپ ساختم اما موقع ران این error رو میده
router.js

class Router extends Component {
    render() {
    const Render = createRootNavigator();
    return (<Render screenProps={1}/>);}}
    export default Router
    export const AppStack = createBottomTabNavigator(
          {Home: {
        screen: Home,
        navigationOptions: {
            tabBarIcon: ({tintColor, focused}) => (
                <View
                    style={[global.tabRouteWrapper, focused ? {backgroundColor: tintColor} : {backgroundColor: 'transparent'}]}>
                    <IconFontAwesome name="home" color={focused ? theme.white : theme.black} size={30}/>
                </View>
            ),
            showLabel: false
        },
    },
    Message: {
        screen: Message,
        navigationOptions: {
            tabBarIcon: ({tintColor, focused}) => (
                <View
                    style={[global.tabRouteWrapper, focused ? {backgroundColor: tintColor} : {backgroundColor: 'transparent'}]}>
                    <IconFontAwesome name="wechat" color={focused ? theme.white : theme.black} size={30}/>
                </View>),
            showLabel: false,
            drawerLockMode: 'locked-closed'
        }
    },
    RequestSubmitt: {
        screen: SubmittRequest,
        navigationOptions: {
            tabBarIcon: ({ tintColor, focused }) => (
                <View style={[global.tabRouteWrapper, focused ? { backgroundColor: tintColor } : { backgroundColor: 'transparent' }]} >
                    <IconAntDesign name="pluscircleo" color={focused ? theme.white : theme.black} size={30} />
                </View>),
            showLabel: false,
        }
    },
    Articles: {
        screen: Article,
        navigationOptions: {
            tabBarIcon: ({ tintColor, focused }) => (
                <View style={[global.tabRouteWrapper, focused ? { backgroundColor: tintColor } : { backgroundColor: 'transparent' }]} >
                    <IconFontAwesome name="file-text-o" color={focused ? theme.white : theme.black} size={30} />
                </View>),
            showLabel: false,
        }
    },
    Profile: {
        screen: Profile,
        navigationOptions: {
            tabBarIcon: ({ tintColor, focused }) => (
                <View style={[global.tabRouteWrapper, focused ? { backgroundColor: tintColor } : { backgroundColor: 'transparent' }]} >
                    <IconFontAwesome name="user" color={focused ? theme.white : theme.black} size={30} />
                </View>),
            showLabel: false,
        }
    },
},
options);
export const createRootNavigator = () => {
let initialRouteName = 'AppStack';
return createSwitchNavigator(
    {  AppStack:AppStack},
    {initialRouteName}
   );
  };

app.js

const initialState = Router.router.getStateForAction(Router.router.getActionForPathAndParams(Home));
const navReducer = (state = initialState, action) => {
const nextState = Router.router.getStateForAction(action, state);
return nextState || state;
};

const appReducer = combineReducers({
nav: navReducer,

 });
const sagaMiddleware =createSagaMiddleware();
const middleware = createReactNavigationReduxMiddleware(
    "root",
state => state.nav,
 );
const AppState = reduxifyNavigator(Router, "root");
const mapStateToProps = (state) => ({
state: state.nav,
});
const store = createStore(
rootSaga,
appReducer,
applyMiddleware(middleware,sagaMiddleware),
 );
const AppWithNavigationState = connect(mapStateToProps)(AppState);
export default class App extends Component<Props> {
 render() 
  return (
    <Provider store={store}>
        <AppWithNavigationState/>
    </Provider>
    );
   }
  }

کسی میدونه مشکل کجاست؟

Cannot read property 'getStateForAction' of undefined
بهترین پاسخ انتخاب شده توسط Mohamad reza golbaba
Mohamad reza golbaba
5 روز پیش

با ورژن پایین تره react-navigation-redux-helpers مشکلم حل شد از دوستان اگر کسی کمک خواست در خدمت هستم

Mohamad reza golbaba ( 1810 تجربه )
2 هفته پیش

راجع به این موضوع نمیدونید؟
@hesammousavi

Mohamad reza golbaba ( 1810 تجربه )
5 روز پیش

با ورژن پایین تره react-navigation-redux-helpers مشکلم حل شد از دوستان اگر کسی کمک خواست در خدمت هستم

برای ارسال پاسخ باید وارد سایت شوید