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

Actions.pop() with data is not working #2075

Closed
rajsuvariya opened this issue Jul 20, 2017 · 7 comments
Closed

Actions.pop() with data is not working #2075

rajsuvariya opened this issue Jul 20, 2017 · 7 comments

Comments

@rajsuvariya
Copy link

Action.Actionname(data) is working but Actions.pop(data) is not working.

Here is my code

      <RedButton
        style={styles.buttonStyle}
        buttonTextStyle={styles.buttonTextStyle}
        onPress = { () => Actions.pop({ refresh: {data: 'dads'}}) }
        >
        Add
      </RedButton>

I have added lot of life cycles methods in parent screen and added log inside them but non of them are getting called.


    componentWillUpdate() {
      console.log('componentWillUpdate');
    }

    componentWillMount(){
        console.log('componentWillMount');
    }

    componentWillUnmount(){
      console.log('componentWillUnmount');
    }

    componentWillReceiveProps(nextProps){
      console.log(nextProps);
    }

I am not even getting undefined. There is no reflection in debug console.

Please check might be the issue with React Native updates. I am using following dependencies.

"dependencies": {
    "react": "16.0.0-alpha.12",
    "react-native": "^0.46.3",
    "react-native-router-flux": "^4.0.0-beta.12"
  }
@aksonov
Copy link
Owner

aksonov commented Jul 20, 2017

Thanks, I will add it to 'migration' section. Use Actions.pop();Actions.refresh({..})

@aksonov aksonov closed this as completed Jul 20, 2017
@rajsuvariya
Copy link
Author

Actions.pop();Actions.refresh({..}) this is work around only right?

@aksonov
Copy link
Owner

aksonov commented Jul 20, 2017

Actually it is not workaround but much better syntax. v3 just was not able to support it.

@aksonov
Copy link
Owner

aksonov commented Jul 20, 2017

However it is not difficult to add old syntax for backward compatibility. Feel free to submit PR.

@rajsuvariya
Copy link
Author

In navigationStore.js the pop is written like this

 pop = () => {
    this.dispatch(NavigationActions.back());
  };

It is even not taking any params. Is it the cause of this problem?

@rajsuvariya
Copy link
Author

rajsuvariya commented Jul 23, 2017

Is this fix live now? If yes, in which version?

@aksonov
Copy link
Owner

aksonov commented Jul 23, 2017

Yes, master branch. Will publish beta.13 soon.

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

2 participants