I am quite sure I haven't made any changes to my code, but a recent npm install, with all versions remaining same, Navigation.push is throwing a warning:
push should be called from a stack child component
I am not even sure what this means! Here's the layout I am using right now:
```js
LoginStack: {
stack: {
children: [{
component: {
name: 'Login'
}
}]
}
}
And this is what I am using to push:
```js
Navigation.push(this.props.componentId, {
component: {
name: 'OTP',
passProps: {phone: this.state.phone}
}
})
You're calling Navigation.push
with a componentId which is not in a stack. You can assign a predefined ID to the stack and use it instead of this.props.componentId
from props.
@guyca That does not seem possible, as the line I am getting this error from is in the "Login" component, which as you can see in the Layout above, is a child in the stack!
@heroic Can you please PR a failing e2e test to the v2 branch? If you're not comfortable writing a Detox test, just PR the problematic layout to the playground app so I can look into this issue.
Im getting the same error
Navigation.setRoot({
root: {
stack: {
id: 'MyStack',
children: [
{
component: {
name: 'SIGNUP',
},
},
{
component: {
name: 'LOGIN',
},
},
],
},
},
})
Then after async action executing
Navigation.push('MyStack', {
component: {
name: 'SIGNUP',
},
})
@ramonallday If you believe this is a bug in RNN, Please PR a failing e2e test.
@guyca https://github.com/wix/react-native-navigation/pull/3310 I hope this makes sense what I am trying to accomplish
@yogevbd Here's a test reproducing the issue
Most helpful comment
Im getting the same error
Then after async action executing