React-native-router-flux: How to use wrapBy with Redux Store?

Created on 24 Sep 2017  路  6Comments  路  Source: aksonov/react-native-router-flux

Version

  • react-native-router-flux v4.0.0-beta.18 (v3 is not supported)
  • react-native v0.47.1

Expected behavior

Want to get the state of current/active screens in memory and do some action in redux store app. Since onEnter/onExit doesn't support calling methods of the component(supports only Static methods calling using Actions.refs.SCENE_NAME.methodName).

Please provide a working example of the same.

Thanks a ton for taking effort in creating this awesome piece.

Most helpful comment

Ok, thanks for update. How would you recommend migrating from Switch?

Old syntax that handled the main auth routing:
component={connect(state => ({ profile: state.auth }))(Switch)}
selector={props => props.profile.user_id ? 'SignedIn' : 'onBoard'}

Thanks!

All 6 comments

Yes, please we'd super appreciate a response on how to get this to work. Doesn't seem like anyone has gotten this working yet.

Anyone figure this out?

I don't use redux for our app, but mobx with wrapBy. Maybe it could be useful for MobX only.

Removed Redux from docs for wrapBy. Feel free to submit PR that allows easier Redux integration.

Ok, thanks for update. How would you recommend migrating from Switch?

Old syntax that handled the main auth routing:
component={connect(state => ({ profile: state.auth }))(Switch)}
selector={props => props.profile.user_id ? 'SignedIn' : 'onBoard'}

Thanks!

Did anyone figure out how to migrate from the old Switch syntax above (@richTheCreator ) to the new onEnter/onExit v4 approach? I can't figure it out and I'm upgrading my project to React 16.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sreejithr picture sreejithr  路  3Comments

fgrs picture fgrs  路  3Comments

sylvainbaronnet picture sylvainbaronnet  路  3Comments

willmcclellan picture willmcclellan  路  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments