React-native-router-flux: popTo(sceneKey, props) not including props in next scene

Created on 15 Nov 2017  路  10Comments  路  Source: aksonov/react-native-router-flux

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
enhancement help wanted

Most helpful comment

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

Hope it helps someone

All 10 comments

It is not yet supported, PR is welcome!

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

Hope it helps someone

@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

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

Sure. Assign the issues it to me if you like

@aksonov isn't that this PR? https://github.com/aksonov/react-native-router-flux/pull/2761

@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.

Same issue here

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

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 }));

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>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

basdvries picture basdvries  路  3Comments

fgrs picture fgrs  路  3Comments

llgoer picture llgoer  路  3Comments

moaxaca picture moaxaca  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments