🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-async-popup

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-async-popup

An accessible promise based popup library for react, to reduce extra state management needed for popups.

0.0.6
latest
Source
npm
Version published
Weekly downloads
42
55.56%
Maintainers
1
Weekly downloads
 
Created
Source

react-async-popup

A promise based popup (confirm and modal) library for react, to reduce extra state management needed for popups. checkout the docs here - https://aadil.dev/react-async-popup

Install

npm install --save react-async-popup

or

yarn add react-async-popup

Usage

import React from 'react'

import { Confirm } from 'react-async-popup'

function App() {

  async function onDelete() {

    const { show } = await Confirm.new();

    const result = await show({
      title: ' Are you sure you want to delete the file ?'
    });

    if (result) {
      console.log(" Yes, Delete the file ")
    }else{
      console.log(" Don't delete ")
    }

  }

  return <button onClick={onDelete}> Delete File </button>
}

Find more examples here - https://aadil.dev/react-async-popup/examples

License

MIT © aadilhasan

Keywords

react-async-popup

FAQs

Package last updated on 08 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts