@silverstripe/reactstrap-confirm
Confirmation dialogues with reactstrap modals
Last updated a month ago by robbieaverill .
BSD-3-Clause · Original npm · Tarball · package.json
$ cnpm install @silverstripe/reactstrap-confirm 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.5                                ...           latest (a month ago)

5 Versions

  • 0.0.5                                ...           a month ago
  • 0.0.4                                ...           4 months ago
  • 0.0.3                                ...           4 months ago
  • 0.0.2                                ...           4 months ago
  • 0.0.1                                ...           4 months ago
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 29
Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |