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

onEnter call action #2847

Closed
sfr-ribeiro opened this issue Jan 31, 2018 · 2 comments
Closed

onEnter call action #2847

sfr-ribeiro opened this issue Jan 31, 2018 · 2 comments

Comments

@sfr-ribeiro
Copy link

Version

"react-native-router-flux": "^4.0.0-beta.28",
"react-native": "0.44.2",
"redux": "^3.6.0",

Expected behaviour

How can I access a redux action (mapped in the scene via mapDispatchToProps) through the onEnter method?

Actual behaviour

I'm having trouble accessing a redux action through the onEnter method within the scene. I think it's because of the onEnter method being static.

Steps to reproduce

class MyContainer extends Component {
  static onEnter() {
    setIsLoggedIn();
  }
  
  ...
  ...
  ...
  ...
  
  const mapDispatchToProps = dispatch => (
  {
    setIsLoggedIn: () => {
      dispatch(setIsLoggedIn());
    },
  }
);

export default connect(null, mapDispatchToProps)(MyContainer);
@afilp
Copy link

afilp commented Feb 14, 2018

Hi! Is there any solution to this?

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
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

3 participants