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

4.2.0 → 4.3.0: TypeError: navigationStore.getStateForAction is not a function. #3746

Open
allenmanning opened this issue Mar 30, 2021 · 10 comments

Comments

@allenmanning
Copy link

Version

  • react-native-router-flux v4.3.0
  • react v16.13.1
  • react-native v0.63.4

Expected behaviour

No component exception, similar to 4.2.0.

Actual behaviour

With upgrade to 4.2.0 → 4.3.0

TypeError: navigationStore.getStateForAction is not a function. (In 'navigationStore.getStateForAction(action, state)', 'navigationStore.getStateForAction' is undefined)

This similar ticket, didn't help me resolve this: #3294

My router:

  const defaultReducer = new Reducer(params);
  return (state, action) => {
    return defaultReducer(state, action);
  };
};

class Routes extends React.Component {

  render() {
    return (
      <Router createReducer={reducerCreate} scenes={scenes} />
    );
  }
}

Routes.propTypes = {
  dispatch: PropTypes.func,
};

export default connect()(Routes);
@aksonov
Copy link
Owner

aksonov commented Mar 30, 2021

Could you reproduce it with react-native/Example or custom fork of it?

@ahsan-abrar
Copy link

"react": "17.0.1",
"react-native": "0.64.0",
"react-native-router-flux": "^4.2.0",

Screenshot_1617913852

@ahsan-abrar
Copy link

here is a quick fix, downgrade react-native-router-flux to react-native-router-flux": "4.0.0-beta.27" and run these commands

watchman watch-del-all
yarn cache clean --force
npm cache clean --force # optional - in case you also have used npm
rm -rf node_modules/
rm yarn.lock
rm package-lock.json # optional - in case you also have used npm
rm -rf $TMPDIR/metro-*
rm -rf $TMPDIR/haste-*
yarn
yarn start --reset-cache

reference:
#3023

@nica0012
Copy link

I am having the same issue, I am trying to get currentscene, so I did redux implementation this same way - the example redux integration doesn't make much sense with everything in app.js, it is very confusing. is there another way to fix this besides downgrading? I have already made significant changes to my whole app because of 4.3.1.

@Sargnec
Copy link

Sargnec commented May 11, 2021

I'm facing this issue also. Upgraded to 4.3.1 because of iphone 12 bottom bar have problem and I saw that issue fixed at 4.3.1 now I'm here

@HessiPard
Copy link

HessiPard commented Jul 26, 2021

have this problem too after upgrade 4.2 => 4.3.1

@allenmanning
Copy link
Author

Is this project being maintained? @aksonov There are many folks running into this.

@ahsan-abrar
Copy link

Is this project being maintained? @aksonov There are many folks running into this.

I think the package was not being maintained, I simply moved to react-navigation

@ekoooo
Copy link

ekoooo commented Oct 19, 2021

same issues

@wg-d
Copy link

wg-d commented Dec 18, 2021

I am having exactly same issue with react-native-router-flux.
I followed @ahsan-abrar , but the issue still persists.

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

8 participants