Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
i have problem with {useDrawerProgress} Hook in react drawer navigator it is not working?

I am trying to make Drawer menu screen transitions but the animation don,t work and I think the problem is {useDrawerProgress} Hook but am not sure, This is my custom-Drawer code

 function StackScreens({ navigation }) {
  const progress = useDrawerProgress();

  const scale = Animated.interpolateNode(progress, {
    inputRange: [0, 1],
    outputRange: [1, 0.8],
  });

  const drawerAnimationStyle = {
    transform: [{ scale }],
  };

  return (
    <Animated.View style={{ flex: 1, ...drawerAnimationStyle }}>
      <ScreenStack.Navigator>
        <ScreenStack.Screen
          name="HomeScreen"
          options={{ headerShown: false, animation: "slide_from_bottom" }}
          component={HomeScreen}
        />
        <ScreenStack.Screen
          name="Chapters"
          component={ChapterScreen}
          options={{
            headerShown: false,
            animation: "slide_from_right",
            presentation: "modal",
          }}
        />
        <ScreenStack.Screen
          name="Profile"
          component={ProfileScreen}
          options={{
            headerShown: false,
            animation: "slide_from_right",
            presentation: "modal",
          }}
        />
        <ScreenStack.Screen
          name="Setting"
          component={SettingScreen}
          options={{
            headerShown: false,
            animation: "slide_from_right",
            presentation: "modal",
          }}
        />
      </ScreenStack.Navigator>
    </Animated.View>
  );
}

This my Drawer-Navigator Components am using react-navigation 6 and all the dependencies are the latest versions

export const DrawerNavigation = () => {
  return (
    <NavigationContainer>
      <Drawer.Navigator
        drawerContent={(props) => {
          return <DrawerContent {...props} />;
        }}
      >
        <Drawer.Screen
          name="Home"
          options={{
            headerShown: false,
            swipeEdgeWidth: 50,
            drawerType: "slide",
            overlayColor: "transparent",
            drawerStyle: {
              width: "50%",
              backgroundColor: "transparent",
            },
            sceneContainerStyle: { backgroundColor: "transparent" },
          }}
        >
          {(props) => <StackScreens {...props} />}
        </Drawer.Screen>
      </Drawer.Navigator>
    </NavigationContainer>
  );
};

it just doesn't work I tried many ways but nothing works so please any help?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I have a similar problem here

But when I use

const scale = Animated.interpolateNode(progress, {
    inputRange: [0, 1],
    outputRange: [1, 0.7],
  });

it throws me error: error in android emulator So I'm using progress.value like this

  const scale = Animated.interpolateNode(progress.value, {
    inputRange: [0, 1],
    outputRange: [1, 0.7],
  });

and the animation doesn't work!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!