We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
type errors The Tabnavigator tabBar parameter receives a React.ReactNode or undefine component, however AnimatedTabBar and of type JSX Element
Describe what you expected to happen:
import React from 'react'; import {NavigationContainer} from '@react-navigation/native'; import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; import AnimatedTabBar, { TabsConfig, BubbleTabBarItemConfig, } from '@gorhom/animated-tabbar'; import HomeIcon from '../Tab/icons/Home'; import ProfileIcon from '../Tab/icons/ProfileIcon'; import Home from '../../screens/Home'; import Profile from '../../screens/Profile'; const tabs: TabsConfig<BubbleTabBarItemConfig> = { Home: { labelStyle: { color: '#5B37B7', }, icon: { component: <HomeIcon />, activeColor: 'rgba(91,55,183,1)', inactiveColor: 'rgba(0,0,0,1)', }, background: { activeColor: 'rgba(223,215,243,1)', inactiveColor: 'rgba(223,215,243,0)', }, }, Profile: { labelStyle: { color: '#1194AA', }, icon: { component: <ProfileIcon />, activeColor: 'rgba(17,148,170,1)', inactiveColor: 'rgba(0,0,0,1)', }, background: { activeColor: 'rgba(207,235,239,1)', inactiveColor: 'rgba(207,235,239,0)', }, }, }; const Tab = createBottomTabNavigator(); export default function App() { return ( <NavigationContainer> <Tab.Navigator tabBar={(props) => { console.log(props); return <AnimatedTabBar tabs={tabs} />; }}> <Tab.Screen name="Home" component={Home} /> <Tab.Screen name="Profile" component={Profile} /> </Tab.Navigator> </NavigationContainer> ); }
The text was updated successfully, but these errors were encountered:
you need to pass tabBar props to AnimatedTabBar
tabBar
AnimatedTabBar
export default function App() { return ( <NavigationContainer> <Tab.Navigator tabBar={(props) => { console.log(props); return <AnimatedTabBar tabs={tabs} {...props} />; }}> <Tab.Screen name="Home" component={Home} /> <Tab.Screen name="Profile" component={Profile} /> </Tab.Navigator> </NavigationContainer> ); }
Sorry, something went wrong.
No branches or pull requests
Bug
type errors The Tabnavigator tabBar parameter receives a React.ReactNode or undefine component, however AnimatedTabBar and of type JSX Element
Steps To Reproduce
Describe what you expected to happen:
Reproducible sample code
The text was updated successfully, but these errors were encountered: