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

230
Vistas
"promisify" a modal and wait for the resolve/reject (react native)

I have a question about this package: react-modal-promise. It is like a wrapper around a modal, and then you can use the modal as a promise.

An example:

MyModal().then(() => console.log('resolved!')).catch(() => console.log('rejected!'));

The modal component would look like this (simplified!):

const MyModal = () => {
  return (
    <Modal>
      <Pressable onPress={resolve}>
        <Text>Resolve this modal</Text>
      </Pressable>
      <Pressable onPress={reject}>
        <Text>Reject this modal</Text>
      </Pressable>
    </Modal>
  );
};

How can I achieve this in react native? I want to upload a photo to my server. When the user clicks a button, I want to open a modal where the user can select a photo and resolve it, after the modal resolve, the photo should be uploaded.

I know I can include my normal modal inside the JSX code, but I am curious about how this package works.

It's for react native.

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