Passing Data Between 2 TabsHow to nest navigators with wrapping Views in React nativePass props to a nested TabnavigatorPassing Firebase data to another screen with React Navigation TabsTrigger Class Function Call from Tab Navigator Tab Press - React Native/NavigationHow to share state between tabs in react-native-router-flux?How to pass variable as a const one in react-navigationreact native render another component in mainReact Navigation - How to pass data across different screens in TabNavigator?passing params to nested TabNavigatorReact Native pass index
Password Hashing Security Using Scrypt & Argon2
Users forgetting to regenerate PDF before sending it
How does one acquire an undead eyeball encased in a gem?
What would +1/+2/+3 items be called in game?
Performance issue in code for reading line and testing for palindrome
Moving millions of files to a different directory with specfic name patterns
Why was such an unrevealing title originally chosen and then changed for some International markets?
Adjust the Table
Who buys a weak currency?
What are the effects of abstaining from eating a certain flavor?
Why is a mixture of two normally distributed variables only bimodal if their means differ by at least two times the common standard deviation?
What does the multimeter dial do internally?
Is it possible for a character at any level to cast all 44 Cantrips in one week without Magic Items?
This LM317 diagram doesn't make any sense to me
Intern not wearing safety equipment; how could I have handled this differently?
Publishing papers seem natural to many, while I find it really hard to think novel stuff to pursue till publication. How to cope up with this?
What exactly is a "murder hobo"?
How should I ask for a "pint" in countries that use metric?
Generalized Behrend version for Grothendieck-Lefschetz trace formula
Writing an ace/aro character?
Can the word "desk" be used as a verb?
QR codes, do people use them?
Did depressed people far more accurately estimate how many monsters they killed in a video game?
Red token deck mass token destruction enchantment protection mtg
Passing Data Between 2 Tabs
How to nest navigators with wrapping Views in React nativePass props to a nested TabnavigatorPassing Firebase data to another screen with React Navigation TabsTrigger Class Function Call from Tab Navigator Tab Press - React Native/NavigationHow to share state between tabs in react-native-router-flux?How to pass variable as a const one in react-navigationreact native render another component in mainReact Navigation - How to pass data across different screens in TabNavigator?passing params to nested TabNavigatorReact Native pass index
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Im building a an app that contain TabNavigator
.
How in the first screen I initalize data that I also need in the second screen.
I want to know what is the best way to pass params between those screens
I've tried to use Navigation.setParams()
from the first screen but in the second I didn't get it.
const PaymentsStack = createStackNavigator(
Payments:
screen: PaymentsScreen
);
const GraphsStack = createStackNavigator(
Graphs: GraphsScreen
);
createBottomTabNavigator(
PaymentsStack,
GraphsStack
);
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = ??;
;
I want to know how to get the importantData
that returned to PaymentsScreen
in GraphsScreen
Thank You
react-native react-navigation react-native-tabnavigator
add a comment |
Im building a an app that contain TabNavigator
.
How in the first screen I initalize data that I also need in the second screen.
I want to know what is the best way to pass params between those screens
I've tried to use Navigation.setParams()
from the first screen but in the second I didn't get it.
const PaymentsStack = createStackNavigator(
Payments:
screen: PaymentsScreen
);
const GraphsStack = createStackNavigator(
Graphs: GraphsScreen
);
createBottomTabNavigator(
PaymentsStack,
GraphsStack
);
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = ??;
;
I want to know how to get the importantData
that returned to PaymentsScreen
in GraphsScreen
Thank You
react-native react-navigation react-native-tabnavigator
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29
add a comment |
Im building a an app that contain TabNavigator
.
How in the first screen I initalize data that I also need in the second screen.
I want to know what is the best way to pass params between those screens
I've tried to use Navigation.setParams()
from the first screen but in the second I didn't get it.
const PaymentsStack = createStackNavigator(
Payments:
screen: PaymentsScreen
);
const GraphsStack = createStackNavigator(
Graphs: GraphsScreen
);
createBottomTabNavigator(
PaymentsStack,
GraphsStack
);
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = ??;
;
I want to know how to get the importantData
that returned to PaymentsScreen
in GraphsScreen
Thank You
react-native react-navigation react-native-tabnavigator
Im building a an app that contain TabNavigator
.
How in the first screen I initalize data that I also need in the second screen.
I want to know what is the best way to pass params between those screens
I've tried to use Navigation.setParams()
from the first screen but in the second I didn't get it.
const PaymentsStack = createStackNavigator(
Payments:
screen: PaymentsScreen
);
const GraphsStack = createStackNavigator(
Graphs: GraphsScreen
);
createBottomTabNavigator(
PaymentsStack,
GraphsStack
);
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = ??;
;
I want to know how to get the importantData
that returned to PaymentsScreen
in GraphsScreen
Thank You
react-native react-navigation react-native-tabnavigator
react-native react-navigation react-native-tabnavigator
edited Mar 26 at 4:51
user11093202
asked Mar 25 at 23:24
aviyam ivgiaviyam ivgi
11 bronze badge
11 bronze badge
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29
add a comment |
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29
add a comment |
1 Answer
1
active
oldest
votes
You could achieve that through getParam
and setParam
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
this.props.navigation.setParams( importantData );
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = this.props.navigation.getParam('importantData');
;
getParam
& getParam
could solve the issue in the case you have in your question ... but I guess this use case is commonly managed by one of the popular global state management tools like redux or unstated as @Edison mentioned in his comment...
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the valueundefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside yourcomponentWillRecieveProps
event
– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator likePaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
|
show 2 more comments
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%2f55347798%2fpassing-data-between-2-tabs%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
You could achieve that through getParam
and setParam
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
this.props.navigation.setParams( importantData );
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = this.props.navigation.getParam('importantData');
;
getParam
& getParam
could solve the issue in the case you have in your question ... but I guess this use case is commonly managed by one of the popular global state management tools like redux or unstated as @Edison mentioned in his comment...
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the valueundefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside yourcomponentWillRecieveProps
event
– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator likePaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
|
show 2 more comments
You could achieve that through getParam
and setParam
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
this.props.navigation.setParams( importantData );
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = this.props.navigation.getParam('importantData');
;
getParam
& getParam
could solve the issue in the case you have in your question ... but I guess this use case is commonly managed by one of the popular global state management tools like redux or unstated as @Edison mentioned in his comment...
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the valueundefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside yourcomponentWillRecieveProps
event
– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator likePaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
|
show 2 more comments
You could achieve that through getParam
and setParam
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
this.props.navigation.setParams( importantData );
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = this.props.navigation.getParam('importantData');
;
getParam
& getParam
could solve the issue in the case you have in your question ... but I guess this use case is commonly managed by one of the popular global state management tools like redux or unstated as @Edison mentioned in his comment...
You could achieve that through getParam
and setParam
class PaymentsScreen extends Component
async componentDidMount()
const importantData = await GetDataFromServer();
this.props.navigation.setParams( importantData );
;
class GraphsScreen extends Component
async componentDidMount()
const importantData = this.props.navigation.getParam('importantData');
;
getParam
& getParam
could solve the issue in the case you have in your question ... but I guess this use case is commonly managed by one of the popular global state management tools like redux or unstated as @Edison mentioned in his comment...
edited Mar 26 at 4:26
answered Mar 26 at 4:21
Hend El-SahliHend El-Sahli
1,4651 gold badge3 silver badges16 bronze badges
1,4651 gold badge3 silver badges16 bronze badges
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the valueundefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside yourcomponentWillRecieveProps
event
– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator likePaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
|
show 2 more comments
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the valueundefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside yourcomponentWillRecieveProps
event
– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator likePaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
This is doesn't work for me...
– aviyam ivgi
Apr 2 at 12:32
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
What error did you get ?
– Hend El-Sahli
Apr 2 at 12:34
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
I can't get the param that I set in the second screen.
– aviyam ivgi
Apr 2 at 20:50
@aviyamivgi is the value
undefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside your componentWillRecieveProps
event– Hend El-Sahli
Apr 2 at 20:54
@aviyamivgi is the value
undefined
? and in shich event handler you tried to grab it ? cause if you're component is aleardy mounted, you 'll need to get the value inside your componentWillRecieveProps
event– Hend El-Sahli
Apr 2 at 20:54
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator like
PaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
I don get it ?? ... I meant to call these handlers inside your screen that you render by your TabNavigator like
PaymentsScreen
– Hend El-Sahli
Apr 2 at 21:33
|
show 2 more comments
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%2f55347798%2fpassing-data-between-2-tabs%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
Why don’t you use state management tools like redux, MobX to manage the entire app’s state?
– Edison D'souza
Mar 26 at 3:14
This is an option but currently I want to solve this without any state manager
– aviyam ivgi
Apr 2 at 12:29