Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sweetalert2 v8 #72

Merged
merged 6 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following options can be React elements:
## Installation

```bash
npm install --save sweetalert2@^7.18.0 sweetalert2-react-content
npm install --save sweetalert2 sweetalert2-react-content
```

## Usage Example
Expand Down
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"
"sweetalert2": "^7.18.0 || ^8.3.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
Expand All @@ -71,7 +71,7 @@
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-terser": "^4.0.4",
"semantic-release": "^15.0.0",
"sweetalert2": "^7.18.0",
"sweetalert2": "^8.3.0",
"tslint": "^5.9.1",
"typescript": "^3.1.3",
"zenflow-lint-js": "^2.0.0"
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'
import { mounts } from './mounts'

const noop = () => {}
const error = message => new Error(`sweetalert2-react-content: ${message}`)

export default function withReactContent(ParentSwal) {
return class extends ParentSwal {
Expand Down Expand Up @@ -49,5 +50,10 @@ export default function withReactContent(ParentSwal) {

return super._main(params)
}
update() {
throw error(
'Swal.update() is not yet supported. See https://github.com/sweetalert2/sweetalert2-react-content/issues/73',
)
}
}
}
3 changes: 1 addition & 2 deletions test/util/swalUtil.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Swal from 'sweetalert2/dist/sweetalert2' // js-only, no styles

async function cleanSwalState() {
Swal.resetDefaults()
await Swal({
await Swal.fire({
animation: false,
title: 'clear',
onOpen: () => Swal.clickConfirm(),
Expand Down