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

228
Views
"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
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!