Natty Precise Maverick

    @silverstripe/reactstrap-confirm

    0.0.5 • Public • Published

    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.

    Install

    npm i @silverstripe/reactstrap-confirm

    DownloadsWeekly Downloads

    12

    Version

    0.0.5

    License

    BSD-3-Clause

    Unpacked Size

    22.6 kB

    Total Files

    21

    Last publish

    Collaborators

    • emteknetnz
    • maxime.rainville
    • robbieaverill
    • silverstripe-admin
    • tractorcow
    • flamerohr
    • sminnee
    • unclecheese
    • chillu
    • cheddam
    • scopey