Skip to content

Commit

Permalink
BREAKING CHANGE: sweetalert2 v9
Browse files Browse the repository at this point in the history
BREAKING CHANGE: sweetalert2 v9
  • Loading branch information
Limon Monte committed Nov 5, 2019
1 parent 70fc8d7 commit 519bcd8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"peerDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0",
"sweetalert2": "^7.18.0 || ^8.3.0"
"sweetalert2": "^9.1.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
Expand All @@ -67,7 +67,7 @@
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-terser": "^5.0.0",
"sweetalert2": "^8.3.0",
"sweetalert2": "^9.1.0",
"tslint": "^5.9.1",
"typescript": "^3.1.3",
"zenflow-lint-js": "^2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function withReactContent(ParentSwal) {
static argsToParams(args) {
if (React.isValidElement(args[0]) || React.isValidElement(args[1])) {
const params = {}
;['title', 'html', 'type'].forEach((name, index) => {
;['title', 'html', 'icon'].forEach((name, index) => {
if (args[index] !== undefined) {
params[name] = args[index]
}
Expand Down
4 changes: 2 additions & 2 deletions src/sweetalert2-react-content.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactElement } from 'react';
import swal, { SweetAlertOptions, SweetAlertResult, SweetAlertType } from 'sweetalert2';
import swal, { SweetAlertIcon, SweetAlertOptions, SweetAlertResult } from 'sweetalert2';

/**
* Wraps SweetAlert2 implementation with a compatible implementation that supports React elements.
Expand All @@ -20,7 +20,7 @@ export default function withReactContent(parentSwal?: SweetAlert2): SweetAlert2
* Mimics SweetAlert2's call signatures, adding React elements as valid inputs.
*/
interface ReactSweetAlert {
(title?: ReactElementOr<'title'>, message?: ReactElementOr<'html'>, type?: SweetAlertType): Promise<SweetAlertResult>;
(title?: ReactElementOr<'title'>, message?: ReactElementOr<'html'>, icon?: SweetAlertIcon): Promise<SweetAlertResult>;

(options: ReactSweetAlertOptions & { useRejections?: false }): Promise<SweetAlertResult>;

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5015,10 +5015,10 @@ supports-color@^6.1.0:
dependencies:
has-flag "^3.0.0"

sweetalert2@^8.3.0:
version "8.13.4"
resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-8.13.4.tgz#66a07848b9ddc344cce3a078bf950b0d1bc8d0b4"
integrity sha512-9hW4GGj08D60bqDPF0paN/NJvsPIDrWSY2fPVmqS4M/XaEsZiNF7HNaObdnQJ0FeD8Q9gJgkkFgvyDdXednT3Q==
sweetalert2@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-9.1.0.tgz#07680b8848bf829709096323990e6049d28c7488"
integrity sha512-z+inI9lvMV0GjvH3CKzHpwIHzTl4DJGlgD4Afgo58xNYMELa2y3CKyXOvEvb8maj7RG703s1cJJRDTkFycAezQ==

symbol-tree@^3.2.2:
version "3.2.4"
Expand Down

0 comments on commit 519bcd8

Please sign in to comment.