torgeadelin / react-native-animated-nav-tab-bar

A simple and customisable React Native component that implements an animated bottom tab bar for React Navigation.
MIT License
902 stars 101 forks source link

Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'? #42

Closed Duya3fithou closed 4 years ago

Duya3fithou commented 4 years ago

I use TypeScript, and install follow your docs. My import:

Screen Shot 2020-09-29 at 10 53 22 AM

My Tab.Navigator:

Screen Shot 2020-09-29 at 11 03 57 AM

After, i wrapp it, and pass to 2 stack is AuthStack and AppStack to check user loggin.

Screen Shot 2020-09-29 at 11 04 52 AM

In App.tsx, my return: Screen Shot 2020-09-29 at 11 05 31 AM

-> However, it through error: Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'? But I wrapper it in App.tsx, How to solve this problem ? "react-native": "0.63.2", "react-native-animated-nav-tab-bar": "^3.0.4", "@react-navigation/native": "^5.1.4", Tks your pretty lib.

torgeadelin commented 4 years ago

I think it's due to the fact that you AppStack is wrapped in Host?

torgeadelin commented 4 years ago

I just replicated you code and it seems to work for me. I think it has nothing to do with this package. Does it work if you replace Tabs with createBottomTabNavigator() instead of Animated..etc?

Duya3fithou commented 4 years ago

if I used createBottomTabNavigator(), it work normally And I try remove Host but it still not working

torgeadelin commented 4 years ago

Could you post more details about your project? Source code for the affected parts? Also include the whole error log. If I can't reproduce I can't really fix it :(

Duya3fithou commented 4 years ago

yep. I used base project from https://github.com/cuongnm2301/demo-app and just change content of file RootSences.tsx to: Link file Here is my problem

Simulator Screen Shot - iPhone X - 2020-09-30 at 14 41 00

Duya3fithou commented 4 years ago

tks you very much becase your quick reply.

torgeadelin commented 4 years ago

No worries! Thanks for the details. I'll have a look once I finish work today:)

torgeadelin commented 4 years ago

Sorry, could you try to share the entire error trace call stack and not just a screenshot? or some logs

torgeadelin commented 4 years ago

Ok, i just cloned the demo app, i installed the package, copy pasted the code you provided in RootScenes and it works. Try to run the app with react-native start --reset-cache, but before that delete the node_modules and install everything again.

Duya3fithou commented 4 years ago

I remove node_modules and reinstall. run react-native start --reset-cache. and it work perfect. tks your lib and support.

algokano commented 4 years ago

same issue "react-native": "0.63.2", "react-native-animated-nav-tab-bar": "^3.0.4", "@react-navigation/native": "^5.6.1", "@react-navigation/stack": "^5.6.2"

timothylui commented 4 years ago

I'm also getting the same issue. If it makes any difference I'm using classes for my components rather than functions.

"react-native": "0.63.3",
"react-native-animated-nav-tab-bar": "^3.0.4",
"@react-navigation/native": "^5.7.4",
"@react-navigation/stack": "^5.6.2",
algokano commented 4 years ago

animated-tabbar worked great for me

torgeadelin commented 4 years ago

@Sarvarr , @timothylui I'm afraid I can't reproduce the issue. It works fine for me on iOS

"@react-navigation/bottom-tabs": "^5.2.7",
"@react-navigation/native": "^5.7.6",
"@react-navigation/stack": "^5.9.3",
"react": "^16.13.1",
"react-native": "0.63.2",

I also tried with class component.