Giter Site home page Giter Site logo

Comments (8)

Sulaiman122 avatar Sulaiman122 commented on June 22, 2024 1

@hoaphantn7604 @arun-saleth
it's slow for me, I don't know why, tried useMemo didn't change
maybe i wrote it wrong, could you explain how to use useMemo or if there is another solution to this issue please help

from react-native-curved-bottom-bar.

arun-saleth avatar arun-saleth commented on June 22, 2024

Yes i am also facing issue while using nesting navigation.when clicking tab icons so much delay to navigate

from react-native-curved-bottom-bar.

hoaphantn7604 avatar hoaphantn7604 commented on June 22, 2024

hi @ducpt-bili , @arun-saleth ,
What steps can I follow to replicate the issue you are experiencing?
Have you tried using React.memo and then wrapping the BottomBar?

from react-native-curved-bottom-bar.

arun-saleth avatar arun-saleth commented on June 22, 2024

I will share my code here

<CurvedBottomBar.Navigator
style={styles.bottomBar}
screenOptions={{ headerShown: false }}
strokeColor="#DDDDDD"
circleWidth={60}
strokeWidth={1}
bgColor="white"
shadowStyle={styles.shawdow}
initialRouteName="Home"
// width={isTablet ? width / 2.3 : width}
borderTopLeftRight
renderCircle={({ selectedTab, navigate }) => (
<Animated.View style={styles.btnCircle}>
<TouchableOpacity
style={{
alignItems: "center",
flex: 1,
justifyContent: "center",
}}
onPress={pressfunc}
>


</Animated.View>
)}
tabBar={RenderTabBar}
>
<CurvedBottomBar.Screen name="Home" position="LEFT" component={Dashboardscreen} />
<CurvedBottomBar.Screen name="Job" component={isTablet && width > 700 ? JobstabletScreen : Jobscreen} position="LEFT" />
<CurvedBottomBar.Screen name="Calendar" component={CalendarScreen} position="RIGHT" />
<CurvedBottomBar.Screen name="Task" component={isTablet && width > 700 ? TasktabletScreen : Taskscreen} position="RIGHT" />
</CurvedBottomBar.Navigator>

const RenderTabBar = ({ routeName, selectedTab, navigate }) => {
return (
<TouchableOpacity
onPress={() => navigate(routeName)}
style={{
height: 50,
alignItems: "center",
}}
>
{_renderIcon(routeName, selectedTab)}

);
};

const _renderIcon = (routeName, selectedTab) => {
let icon = "";
switch (routeName) {
case "Home":
icon = routeName === selectedTab ? :
break;
case "Job":
icon = routeName === selectedTab ? :
break;
case "Calendar":
icon = routeName === selectedTab ? :
break;
case "Task":
icon = routeName === selectedTab ? :
break;
}

return (
    <View style={styles.btmname}>
        <View>{icon}</View>
        <Text style={{ color: routeName === selectedTab ? Color.skyblue : "grey" }}>
            {routeName}
        </Text>
    </View>
);

};

My nesting navigation structure:

 ------------------ Inside Drawernavigation I am using tab navigation -----------------------------------------   
    
        
         <Drawer.Navigator screenOptions={{ headerShown: false }} initialRouteName='HomeDrawer' drawerContent={(props) => <CustomDrawerContent
        {...props} />}>
        <Drawer.Screen name="HomeDrawer" component={TabNavigation} options={{ title: 'Home' }} />
    </Drawer.Navigator>

from react-native-curved-bottom-bar.

arun-saleth avatar arun-saleth commented on June 22, 2024

@hoaphantn7604 when I expect this? .too much lagging

from react-native-curved-bottom-bar.

arun-saleth avatar arun-saleth commented on June 22, 2024

@hoaphantn7604 I tried memo.Its woking perfectly.Thank you for your Suggestions

from react-native-curved-bottom-bar.

jelyqs avatar jelyqs commented on June 22, 2024

Hi @arun-saleth

Can you share with me where to handle useMemo?

from react-native-curved-bottom-bar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.