Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments callee and caller cannot be accessed in strict mode #20

Closed
gkrinc opened this issue Sep 21, 2016 · 1 comment
Closed

arguments callee and caller cannot be accessed in strict mode #20

gkrinc opened this issue Sep 21, 2016 · 1 comment

Comments

@gkrinc
Copy link

gkrinc commented Sep 21, 2016

I get this error from my route reducer which is a copy of the provided redux example:

screen shot 2016-09-21 at 1 36 16 pm

import { ActionConst } from 'react-native-router-flux';

const initialState = {
    scene: {
        sceneKey: null
    }
};

export default function route(state = initialState, action) {
    switch (action.type) {
        // focus action is dispatched when a new screen comes into focus
        case ActionConst.FOCUS:
            return {
                ...state,
                scene: action.scene
            };

        // ...other actions

        default:
            return state;
    }
}

If I remove the case ActionConst.FOCUS the error goes away, but I lose the ability to know which scene is current.

This is my router setup:

const RouterWithRedux = connect()(Router);

class MyApp extends React.Component {
...
  render() {
    return (
      <Provider store={store}>
        <AppDrawersContainer>
          <RouterWithRedux hideNavBar={true}>
            <Scene key="root" renderTitle={() => { return <AppLogo /> }}>
              <Scene key="launch" component={LaunchPage} title="Launch" initial={true}/>
              <Scene key="venues" component={VenuePage} title="Venues"/>
              <Scene key="home" component={HomePage} title="Home" />
            </Scene>
          </RouterWithRedux>
        </AppDrawersContainer>
      </Provider>
    );
  }
}

I'm don't have the createReducer prop on my router, cause I assume that's what this is taking care of:

const RouterWithRedux = connect()(Router);

If I remove redux-freeze the problem goes away...I assume something is mutating state when it shouldn't be.

This code from Actions.js seems to be what's causing the error:

focus(props = {}) {
  return this.callback({ ...filterParam(props), type: ActionConst.FOCUS });
}

Any help would be REALLY appreciated.

Versions
"react-native": "0.34.0-rc.0",
"react-native-router-flux": "3.34.0" (I downgraded because of another problem I was having)

@gkrinc
Copy link
Author

gkrinc commented Sep 22, 2016

Move to react-native-router-flux: aksonov/react-native-router-flux#1210

@gkrinc gkrinc closed this as completed Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant