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;
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
add a comment |
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
In what component you are trying to getaandbparams ?
– Alexandr Zavalii
Mar 25 at 21:56
add a comment |
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
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
react-native react-navigation
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 getaandbparams ?
– Alexandr Zavalii
Mar 25 at 21:56
add a comment |
In what component you are trying to getaandbparams ?
– 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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 26 at 6:36
SoftwareTheorySoftwareTheory
9732 gold badges11 silver badges29 bronze badges
9732 gold badges11 silver badges29 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
In what component you are trying to get
aandbparams ?– Alexandr Zavalii
Mar 25 at 21:56