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

popTo(sceneKey, props) not including props in next scene #2621

Closed
wolverineks opened this issue Nov 15, 2017 · 10 comments
Closed

popTo(sceneKey, props) not including props in next scene #2621

wolverineks opened this issue Nov 15, 2017 · 10 comments

Comments

@wolverineks
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.24
  • react-native v0.47.2

Expected behaviour

Props passed into Actions.popTo(sceneKey, props) available on next scene

Actual behaviour

Props on next scene do not include props passed into Actions.popTo(sceneKey, props)

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  1. Dispatch thunk-action
  2. Call Actions.popTo(sceneKey, props) from body of thunk
  3. Check props on next scene
@aksonov
Copy link
Owner

aksonov commented Jan 4, 2018

It is not yet supported, PR is welcome!

@jomaint
Copy link

jomaint commented Jan 18, 2018

For those whos looking for a temporary solution:
Add this right after Actions.popTo
Actions.refresh({ propName: value })

Hope it helps someone

@mvanroon
Copy link
Contributor

mvanroon commented Feb 9, 2018

@aksonov would you be OK with Action.refresh()-ing underwater if popTo() was given extra props?
if yes then I'll make a PR this week

@aksonov
Copy link
Owner

aksonov commented Feb 9, 2018

Yes, it will be OK. Another issue that popTo doesn't work now with latest beta as reported, could you check that?

@mvanroon
Copy link
Contributor

mvanroon commented Feb 9, 2018

Sure. Assign the issues it to me if you like

@aksonov isn't that this PR? #2761

@mvanroon
Copy link
Contributor

@aksonov I have a fix ready for this issue, but I can't run 0.28 because replace() broke. I'll continue working on this when that one (#2799) has been fixed. Unfortunately I don't have time to work on fixing that issue right now.

@VicFrolov
Copy link

Same issue here

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
@EthanDM
Copy link

EthanDM commented Oct 12, 2018

For those whos looking for a temporary solution:
Add this right after Actions.popTo
Actions.refresh({ propName: value })

Hope it helps someone

FYI for anyone using the RNRF v4.x (non beta) with React Navigation 2.0, you'll need to wrap Actions.refresh({ propName: value }) in a setTimeout for it to work:

Actions.popTo('scene'); setTimeout(() => Actions.refresh({ propName: value }));

@douglasheldpacito
Copy link

douglasheldpacito commented Feb 14, 2019

I had that issue

"dependencies": {
    "@expo/vector-icons": "^9.0.0",
    "axios": "^0.18.0",
    "expo": "^32.0.0",
    "moment": "^2.23.0",
    "native-base": "^2.10.0",
    "qs": "^6.6.0",
    "react": "16.5.0",
    "react-moment": "^0.8.4",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "react-native-router-flux": "^4.0.6"
  }
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.%s, 
    in NotaFiscal (at navigationStore.js:448)
    in Wrapped (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:478)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in AnimatedComponent (at screens.native.js:59)
    in Screen (at StackViewCard.js:42)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:507)

Stack trace:
  node_modules\react-native\Libraries\YellowBox\YellowBox.js:59:8 in error
  node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:619:8 in warningWithoutStack
  node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:13205:6 in warnAboutUpdateOnUnmounted
  node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:14683:33 in scheduleWork
  node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:7700:17 in enqueueSetState
  node_modules\react\cjs\react.development.js:364:31 in setState
  imports\ui\Screens\NotasFiscais\NotaFiscal.js:38:26 in <unknown>
  imports\database\Database.js:286:25 in <unknown>
  node_modules\@expo\websql\lib\websql\WebSQLTransaction.js:70:30 in <unknown>
  node_modules\expo\build\SQLite.js:16:21 in <unknown>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants