-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
actions[type] is not a function #2017
Comments
try using type={'back'} instead. |
Not 'back', but 'pop'. I'm not sure about support of 'refresh' inside pop. Could you just raise two actions? |
yep, it's pop and not back. But if I do use type={'pop'} navigating to this scene behaves like pop -> it just pops the last scene from the stack. And since on the scene I am I have a tabbar -> when you navigate between the tabs and then hit the actions.companies() buttons you first switch between the tabs and once they are off the stack you navigate back to hte companies page. And I just want to directly transition back to companies no matter how many screens there are on the stack. I tried popTo, but it seems to cause some endless loop or so... The app freezes :) |
You should pass child scene to pop to, not container one. |
okaay, so adding type={'popTo'} to the scene seems to work fine. Using Actions.popTo({scene: 'companies'}) seems to cause the endless loop |
Because 'companies' is not child. |
Why does companies need to be a child? It's a parent in this case and I would like to navigate back to the parent? And what's with refresh now? Can we use it in v4 or not?
This doesn't seem to pass goBack as property to the previous scene. No matter if I use type={'popTo'} or not. It just doesn't seem to pass the property back to the previous scene. ComponentWillReceiveProps is never fired. |
'Companies' is stack. Stack cannot be presented, you always see some child within the stack. |
Sorry, I'm lost. I don't understand what you mean with " Stack cannot be presented, you always see some child within the stack." companies is the first scene in the stack. unfortunatly passing params as second argument doesn't do anything. I tried it with 2 calls like this:
wtf was auto added to props.navigation.state.params. So we no longer need to use the refresh object? |
Have you tried |
Yep,that also seems to work.
|
On current scene. After |
I have this code with v3:
and I have a scene that calls Actions.companies({refresh: { goBack: true }})
that was working fine on v3, but on v4 I get actions[type] is not a function.
If I remove type={ActionConst.BACK}, then I no longer get the error, but the scene transitions from the wrong side. It seems like it's being added on the stack, but it should behave like pop() - removing the current scene to show the one below.
The text was updated successfully, but these errors were encountered: