{"repo":"GSTJ/magic-modal","free":true,"listed":false,"github":"https://github.com/GSTJ/magic-modal","clone":"git clone https://github.com/GSTJ/magic-modal.git","description":"A magic modal you can await from anywhere: React Native, Expo, and the web. 🦄","language":"TypeScript","stars":633,"topics":["react-native","modal","typescript","hacktoberfest","nextjs","react-native-web","web"],"license":"MIT","category":"mobile-apps","readme_excerpt":"Mount one portal. Open a modal from any async flow and await a typed result on Expo, React Native, or the web. Docs GitHub FAQ Article How it works 1. MagicModalPortal owns the modal stack. Mount it once, near the root. 2. magicModal.show() pushes one entry and returns an awaitable handle. 3. useMagicModal().hide(data) closes that entry with typed data. 4. The handle resolves to HideReturn , including the close reason. The handle is the promise itself, carrying that entry's modalID , update , and hide . The caller resumes with submitted data or the exact dismissal reason. const { promise, modalID, update } = magicModal.show(...) still works; promise is a deprecated alias of the handle itself. Every stack entry keeps its own component, configuration, ID, and promise. A second show() call can open above the current modal without mixing their results. Installation Expo chooses versions compatible with the installed SDK. Expo Web Expo Web bundles through Metro under the react-native condition, so it loads the native entry and takes the same peers as iOS and Android. The browser-only install is the Next.js one below. Read the Expo guide for the portal and web command. Expo iOS Expo Android iOS and Android use the same native dependency set. The native guide covers pods, Android back handling, and iOS overlays. Next.js and other browser-only React apps That is the whole install. The web entry ships with zero React Native dependencies, so a browser application needs no bundler alias","default_branch":null,"files":null,"tree":[],"storefront":"/r/GSTJ","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/GSTJ/magic-modal/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}