I can't pass parameters using react-navigation in react-native while navigating from a tab navigator screen to a stack navigator screenReact Native - Stack Navigator, close multiple viewsPassing params in Redux + React Native + react-navigatorHow to send parameters from screen to stack navigator?React Navigation: multiple nested navigators - Stack -> Tab Nav -> Tab Nav/Router(can't decide) -> stackHow to pass variable as a const one in react-navigationHow to handle if tab icon press is the current screen with react navigationSeparate Navigation in React Native NavigationReact Navigation unable to pass params into nested navigatorNavigate to a react-native screen undefined prop navigationParameter passing in react native navigation

What is the meaning of "prairie-dog" in this sentence?

How does the cloaker's Phantasms action work?

Computer name naming convention for security

Why does the Misal rico de Cisneros uses the word "Qiſſa", and what is it supposed to mean? Why not "Miſſa" (Missa)?

My professor has told me he will be the corresponding author. Will it hurt my future career?

Interpretation of non-significant results as "trends"

Why is there paternal, for fatherly, fraternal, for brotherly, but no similar word for sons?

The flying colours

What's the difference between a type and a kind?

In layman's terms, does the Luckstone just give a passive +1 to all d20 rolls and saves except for death saves?

Why do Martians have to wear space helmets?

Category-theoretic treatment of diffs, patches and merging?

How do resistors generate different heat if we make the current fixed and changed the voltage and resistance? Notice the flow of charge is constant

Who goes first? Person disembarking bus or the bicycle?

WPF Palindrome Checker Application

Does the Milky Way orbit around anything?

Can a USB hub be used to access a drive from two devices?

Taking my Ph.D. advisor out for dinner after graduation

Was it ever illegal to name a pig "Napoleon" in France?

QR codes, do people use them?

Attach a visible light telescope to the outside of the ISS

When is one 'Ready' to make Original Contributions to Mathematics?

Is it a good option to send images over LoRa network?

How do ballistic trajectories work in a ring world?



I can't pass parameters using react-navigation in react-native while navigating from a tab navigator screen to a stack navigator screen


React Native - Stack Navigator, close multiple viewsPassing params in Redux + React Native + react-navigatorHow to send parameters from screen to stack navigator?React Navigation: multiple nested navigators - Stack -> Tab Nav -> Tab Nav/Router(can't decide) -> stackHow to pass variable as a const one in react-navigationHow to handle if tab icon press is the current screen with react navigationSeparate Navigation in React Native NavigationReact Navigation unable to pass params into nested navigatorNavigate to a react-native screen undefined prop navigationParameter passing in react native navigation






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I think this is pretty straight forward when it comes to passing between screens of tab navigators but there seems to be a problem while trying to pass parameters from a tab navigator screen to a stack navigator screen in react-native using react-navigation.



I tried this:



onPress=() => 
this.props.navigation.navigate('review',
aa1: 86,
bb1: 'anything you want here',
);



And this:



onPress=() => this.props.navigation.dispatch(NavigationActions.navigate( routeName: 'review', params: aa1: 'x' , ))


as the onPress handler of my TouchableOpacity. None of them work. I can navigate but I can't get the params.



Below is how I try to get the parameters in the target stack navigator screen:



const navigation = this.props;
//if a is not passed, No a is the default value.
const a = this.props.navigation.getParam('aa1', 'NO a');
const b = navigation.getParam('bb1', 'No b');


Any ideas?










share|improve this question






















  • In what component you are trying to get a and b params ?

    – Alexandr Zavalii
    Mar 25 at 21:56


















0















I think this is pretty straight forward when it comes to passing between screens of tab navigators but there seems to be a problem while trying to pass parameters from a tab navigator screen to a stack navigator screen in react-native using react-navigation.



I tried this:



onPress=() => 
this.props.navigation.navigate('review',
aa1: 86,
bb1: 'anything you want here',
);



And this:



onPress=() => this.props.navigation.dispatch(NavigationActions.navigate( routeName: 'review', params: aa1: 'x' , ))


as the onPress handler of my TouchableOpacity. None of them work. I can navigate but I can't get the params.



Below is how I try to get the parameters in the target stack navigator screen:



const navigation = this.props;
//if a is not passed, No a is the default value.
const a = this.props.navigation.getParam('aa1', 'NO a');
const b = navigation.getParam('bb1', 'No b');


Any ideas?










share|improve this question






















  • In what component you are trying to get a and b params ?

    – Alexandr Zavalii
    Mar 25 at 21:56














0












0








0








I think this is pretty straight forward when it comes to passing between screens of tab navigators but there seems to be a problem while trying to pass parameters from a tab navigator screen to a stack navigator screen in react-native using react-navigation.



I tried this:



onPress=() => 
this.props.navigation.navigate('review',
aa1: 86,
bb1: 'anything you want here',
);



And this:



onPress=() => this.props.navigation.dispatch(NavigationActions.navigate( routeName: 'review', params: aa1: 'x' , ))


as the onPress handler of my TouchableOpacity. None of them work. I can navigate but I can't get the params.



Below is how I try to get the parameters in the target stack navigator screen:



const navigation = this.props;
//if a is not passed, No a is the default value.
const a = this.props.navigation.getParam('aa1', 'NO a');
const b = navigation.getParam('bb1', 'No b');


Any ideas?










share|improve this question














I think this is pretty straight forward when it comes to passing between screens of tab navigators but there seems to be a problem while trying to pass parameters from a tab navigator screen to a stack navigator screen in react-native using react-navigation.



I tried this:



onPress=() => 
this.props.navigation.navigate('review',
aa1: 86,
bb1: 'anything you want here',
);



And this:



onPress=() => this.props.navigation.dispatch(NavigationActions.navigate( routeName: 'review', params: aa1: 'x' , ))


as the onPress handler of my TouchableOpacity. None of them work. I can navigate but I can't get the params.



Below is how I try to get the parameters in the target stack navigator screen:



const navigation = this.props;
//if a is not passed, No a is the default value.
const a = this.props.navigation.getParam('aa1', 'NO a');
const b = navigation.getParam('bb1', 'No b');


Any ideas?







react-native react-navigation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 21:16









SoftwareTheorySoftwareTheory

9732 gold badges11 silver badges29 bronze badges




9732 gold badges11 silver badges29 bronze badges












  • In what component you are trying to get a and b params ?

    – Alexandr Zavalii
    Mar 25 at 21:56


















  • In what component you are trying to get a and b params ?

    – Alexandr Zavalii
    Mar 25 at 21:56

















In what component you are trying to get a and b params ?

– Alexandr Zavalii
Mar 25 at 21:56






In what component you are trying to get a and b params ?

– Alexandr Zavalii
Mar 25 at 21:56













1 Answer
1






active

oldest

votes


















1














I was able to figure and solve the problem.
Problem was that name of the screen I was trying to navigate to and the name of the stack navigator (name of the stack navigator in the containing/parent tab navigator) that contained that screen was the same. And although navigation was working, the parameters were not being passed as I said in the problem description. Navigation was working because the screen that I was trying to navigate was set as the initial route in the containing stack navigator. Apparently, I was navigating and passing the parameters to the containing stack navigator. Once I changed the name of the stack navigator, the problem was solved.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346524%2fi-cant-pass-parameters-using-react-navigation-in-react-native-while-navigating%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I was able to figure and solve the problem.
    Problem was that name of the screen I was trying to navigate to and the name of the stack navigator (name of the stack navigator in the containing/parent tab navigator) that contained that screen was the same. And although navigation was working, the parameters were not being passed as I said in the problem description. Navigation was working because the screen that I was trying to navigate was set as the initial route in the containing stack navigator. Apparently, I was navigating and passing the parameters to the containing stack navigator. Once I changed the name of the stack navigator, the problem was solved.






    share|improve this answer



























      1














      I was able to figure and solve the problem.
      Problem was that name of the screen I was trying to navigate to and the name of the stack navigator (name of the stack navigator in the containing/parent tab navigator) that contained that screen was the same. And although navigation was working, the parameters were not being passed as I said in the problem description. Navigation was working because the screen that I was trying to navigate was set as the initial route in the containing stack navigator. Apparently, I was navigating and passing the parameters to the containing stack navigator. Once I changed the name of the stack navigator, the problem was solved.






      share|improve this answer

























        1












        1








        1







        I was able to figure and solve the problem.
        Problem was that name of the screen I was trying to navigate to and the name of the stack navigator (name of the stack navigator in the containing/parent tab navigator) that contained that screen was the same. And although navigation was working, the parameters were not being passed as I said in the problem description. Navigation was working because the screen that I was trying to navigate was set as the initial route in the containing stack navigator. Apparently, I was navigating and passing the parameters to the containing stack navigator. Once I changed the name of the stack navigator, the problem was solved.






        share|improve this answer













        I was able to figure and solve the problem.
        Problem was that name of the screen I was trying to navigate to and the name of the stack navigator (name of the stack navigator in the containing/parent tab navigator) that contained that screen was the same. And although navigation was working, the parameters were not being passed as I said in the problem description. Navigation was working because the screen that I was trying to navigate was set as the initial route in the containing stack navigator. Apparently, I was navigating and passing the parameters to the containing stack navigator. Once I changed the name of the stack navigator, the problem was solved.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 26 at 6:36









        SoftwareTheorySoftwareTheory

        9732 gold badges11 silver badges29 bronze badges




        9732 gold badges11 silver badges29 bronze badges
















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid …


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346524%2fi-cant-pass-parameters-using-react-navigation-in-react-native-while-navigating%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh