Socket
Socket
Sign inDemoInstall

react-sweetalert2

Package Overview
Dependencies
7
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.4.1

9

build/index.js

@@ -55,3 +55,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

var SweetAlert2 = function (props) {
var show = props.show, showLoading = props.showLoading, onConfirm = props.onConfirm, onError = props.onError, willOpen = props.willOpen, children = props.children, rest = __rest(props, ["show", "showLoading", "onConfirm", "onError", "willOpen", "children"]);
var show = props.show, showLoading = props.showLoading, onConfirm = props.onConfirm, onResolve = props.onResolve, onError = props.onError, willOpen = props.willOpen, children = props.children, rest = __rest(props, ["show", "showLoading", "onConfirm", "onResolve", "onError", "willOpen", "children"]);
React.useEffect(function () {

@@ -66,7 +66,10 @@ mount();

ReactDOM__default['default'].render(children, element);
rest.html = element;
}
willOpen && willOpen(el);
};
Swal__default['default'].fire(rest).then(function (result) { return onConfirm && onConfirm(result); }).catch(function (error) { return onError && onError(error); });
Swal__default['default'].fire(rest).then(function (result) {
if (result.isConfirmed)
onConfirm && onConfirm(result);
onResolve && onResolve(result);
}).catch(function (error) { return onError && onError(error); });
if (showLoading)

@@ -73,0 +76,0 @@ Swal__default['default'].showLoading();

{
"name": "react-sweetalert2",
"version": "0.4.0",
"version": "0.4.1",
"author": {

@@ -28,3 +28,2 @@ "name": "Kesse Jones"

"dependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"react": "^17.0.1",

@@ -31,0 +30,0 @@ "react-dom": "^17.0.1",

@@ -95,3 +95,3 @@ # React sweetalert2

text: 'Swal injected',
type: 'success',
icon: 'success',
});

@@ -121,3 +121,3 @@ }

text: 'Swal injected',
type: 'success',
icon: 'success',
});

@@ -164,6 +164,6 @@ }

<SweetAlert2 {...swalProps}
onOpen={() => {
didOpen={() => {
// run when swal is opened...
}}
onClose={() => {
didClose={() => {
// run when swal is closed...

@@ -177,2 +177,5 @@ }}

}}
onResolve={result => {
// run when promise is resolved...
}}
/>

@@ -196,6 +199,6 @@ </div>

text: 'Hello World',
onOpen: () => {
didOpen: () => {
// run when swal is opened...
},
onClose: () => {
didClose: () => {
// run when swal is closed...

@@ -202,0 +205,0 @@ }

import packageJson from './package.json';
import typescript from "rollup-plugin-typescript2";
// import { nodeResolve } from '@rollup/plugin-node-resolve';
// import commonjs from '@rollup/plugin-commonjs';

@@ -23,6 +21,2 @@ const external = [

plugins: [
// nodeResolve(),
// commonjs({
// include: /node_modules/,
// }),
typescript(),

@@ -29,0 +23,0 @@ ],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc