question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Actions.Push not passing in props to component or scene?

See original GitHub issue

Version

Tell us which versions you are using:

react-native-router-flux: v4.0.1 react: v16.3.1 react-native: v0.55.2 Typescript: v2.8.3

Expected behaviour

When I use Actions.push(“route”, {title: “some title”}) or any other variations I have found i your docs it doesn’t seem to add anything to the props. The push will work correctly but it won’t add the new props.

Actual behaviour

I would expect the props to be added to the component / scene when added to a push.

What I’ve tried

In components to navigate:

Actions.push("wishlistDetails", { title: "title" });
Actions.push("wishlistDetails", { props: { title: "title" } });
Actions.wishlistDetails({title: "title"});
Actions.wishlistDetails({ props: { title: "title" } });

Inside ComponentDidMounts/ willMounts etc

Actions.refresh({ props: { title: "title" } });
Actions.refresh({ title: "title" });

I’ve gone around stack overflow and nothing seems to work. If I pass whatever prop directly into the scene it will be passed through to the component and the Scene, but the action function doesn’t seem to do anything.

Any help would be much appreciated!!

Thanks,

Chris

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gradamcommented, Nov 12, 2018

@codepressd If you have your screens nested try Actions._wishlistDetails(props) (note added _).

0reactions
cybercriscommented, Mar 8, 2022

Thanks @gradam it works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Router Flux props not passing through action
hi try to add _ befor the second screen key onPress={() => Actions._dashboard({ demoMode: true, })}. something like that but if it doesn't ......
Read more >
How passing props to component works in React
Master how to pass props (properties) to components in React with this useful beginner's guide, including demo code.
Read more >
Actions.Push not passing in props to component or scene?
If I pass whatever prop directly into the scene it will be passed through to the component and the Scene, but the action...
Read more >
How to use the react-native-router-flux.Actions.push function ...
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
Navigation prop reference
It's important to highlight the navigation prop is not passed in to all components; only screen components receive this prop automatically!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found