New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@silverstripe/reactstrap-confirm

Package Overview
Dependencies
Maintainers
10
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silverstripe/reactstrap-confirm

Confirmation dialogues with reactstrap modals

0.0.5
latest
npm
Version published
Weekly downloads
0
Maintainers
10
Weekly downloads
 
Created
Source

Reactstrap Confirm

A confirm "polyfill" that creates a reactstrap modal instead of a browser dialog

Requirements

  • React 15+
  • Webpack

Usage

import confirm from '@silverstripe/reactstrap-confirm';
import { Button } from 'reactstrap';

const MyButton = () => {
  const handleClick = async () => {
    if (!await confirm('Are you sure?')) {
      return;
    }
  };

  return <Button onClick={handleClick()}>Click me</Button>;  
}

The confirm function returns a promise that will be resolved with true or false depending on the response of the user. This will render a reactstrap modal into a given DOM node (or document.body by default).

Run yarn storybook for a detailed example.

Keywords

react

FAQs

Package last updated on 21 Aug 2019

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