Closed terreb closed 5 years ago
Same! 😞 @guyca could you please help us? Maybe we are doing something wrong )
I'm getting the same error using custom components since 2.0.2500. The only way to avoid this error is by adding ids to the button object:
{
id: 'buttonOne',
component: {
id: 'buttonOne',
name: 'example.CustomButtonComponent'
},
}
On Android, I have this index=3,count=2
error. I have to add a total of 3 right buttons in order to avoid the error. I can't add less than 3 right buttons since 2.0.2500.
@stonecold123, in my case I'm just trying to style those buttons globally. Ids should be added for specific components, not in Navigation.setDefaultOptions which is reasonable. Still I have that crash.
I can also confirm this is happening.
react-native-navigation@2.0.2577
react-native@0.56.1
Platform is android, but not happening on iOS (which seems to be complete opposite of the OP).
I have this issue too. But I have in my project react-navigation and react-native-navigation. So I added top bar to react-navigation screen not in react-native-navigation ;D
react-native-navigation@2.0.2580
react-navigation@2.17.0
react-native@0.56.0
How I load screens? If user logged in I setRoot with
toHomeNavigation(): void
{
Navigation.setRoot({
root: {
sideMenu: {
left: {
component: {
id: HOME_SIDE_MENU_ID,
name: HOME_SIDE_MENU_NAME,
options: {
layout: {
orientation: ['portrait']
},
},
}
},
center: {
stack: {
children:[
{
component: {
id: HOME_ID,
name: HOME_NAME,
options: {
layout: {
orientation: ['portrait']
},
topBar: {
visible: false,
drawBehind: true,
animate: false,
}
}
}
}
]
}
},
},
}
});
}
So main home screen loads react-navigation
. If I specify custom topBar
in react-native-navigation
so its crashing. Its says index=3,count=2
. But in another project where is only react-native-navigation
its works, but I discovered its chrashed only if something wrong in custom component. I think when in my case was some mistake when loading wrong in array.
Any solution?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Issue Description
I'm using an example from migration docs to apply colors to topBar buttons https://wix.github.io/react-native-navigation/v2/#/docs/options-migration?id=navbarbuttoncolor:
When this is added the app crashes. In the console I see the next error:
Steps to Reproduce / Code Snippets / Screenshots
Please see above
Environment