Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda