react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Can we get navigator object in redux so that we can dispatch push pop in thunk action creator ?

Open ParshantArora opened this issue 8 years ago • 6 comments

How we can get navigator object in redux so that we can dispatch push pop in thunk action creator? Description : Hi the react-native-navigation is very good in terms of performance . I am new to react-native-navigation earlier i was working on react-navigation in which we can get navigator object in redux for handing push pop but in this navigation how we can get that or please mention the steps to do the same task Thanks

ParshantArora avatar Sep 12 '18 17:09 ParshantArora

import { Navigation } from "react-native-navigation"

// inside your redux-thunk action 

export const doSomeActionWithThunk = () => async (dispatch, getState) => { 
  ..
  dispatch({ ...
  ..
  Navigation.push..
  Navigation.pop..
}

hisothreed avatar Sep 12 '18 23:09 hisothreed

Don't forget you can await a Navigation.push/pop so it fits perfectly inside thunks as is.

ItsNoHax avatar Sep 13 '18 13:09 ItsNoHax

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the react-native-navigation tag.

support avatar Sep 13 '18 16:09 support

Thanks @ItsNoHax and @hisothreed

ParshantArora avatar Sep 17 '18 17:09 ParshantArora

how are we able to do Navigation.push without a this.props.componentId

gethabit avatar Jan 16 '19 13:01 gethabit

just pass this.props.componentId in your redux action. @gethabit

yeomann avatar Mar 26 '19 17:03 yeomann