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

206
Vistas
ReactJs (native) - Transition variable from one value to another incrementally

Is there a way to make a transitional change of value with increments over time in React native (or any method in JS that I don't know of / can't find?

I could of course create some sort of loop with interval or setTimeout, but I was wondering if there is something like the Animated API with interpolation that could be used to just change a value when there is not actually any view that is being animated?

In my case I want to change the screen brightness of the users device smoothly, right now it goes from 0-1 instantly, which is not what I want.

I will provide code in case anyone would like to see that. This process takes place in a useEffect() that reacts when the user is opening a scannable code on their screen.

    const [brightness, setBrightness] = useState(null);
     ...
     ...
         useEffect(() => {
               (async () => {
                    const currentBrightness =
                        await DeviceBrightness.getBrightnessLevel();
                    setBrightness(currentBrightness);
                })();
                if (isOpened) {
                    DeviceBrightness.setBrightnessLevel(1);
                }
                if (!isOpened && brightness) {
                    DeviceBrightness.setBrightnessLevel(brightness);
                }
        }, [isOpened]);
about 4 years ago · Juan Pablo Isaza
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