react-confirm 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -108,3 +108,11 @@ const handleOnClick2 = async () => {
108
108
 
109
109
  You can check more complex example in [codesandbox](https://codesandbox.io/s/react-confirm-with-react-bootstrap-kjju1)
110
110
 
111
+
112
+ ## typescript
113
+
114
+ Experimentally added full typescript declaration files at `typescript` branch.
115
+
116
+ see [typescript example](https://github.com/haradakunihiko/react-confirm/tree/typescript/example/ts-react-bootstrap).
117
+
118
+ and try `npm install git@github.com:haradakunihiko/react-confirm.git#typescript` to use in your project.
@@ -36,8 +36,8 @@ var createConfirmation = function createConfirmation(Component) {
36
36
  setTimeout(function () {
37
37
  root.unmount();
38
38
  setTimeout(function () {
39
- if (document.body.contains(wrapper)) {
40
- document.body.removeChild(wrapper);
39
+ if (wrapper && wrapper.parentNode) {
40
+ wrapper.parentNode.removeChild(wrapper);
41
41
  }
42
42
  });
43
43
  }, unmountDelay);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-confirm",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Small library which makes your Dialog component callable",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -26,9 +26,9 @@ const createConfirmation = (Component, unmountDelay = 1000, mountingNode) => {
26
26
  setTimeout(() => {
27
27
  root.unmount();
28
28
  setTimeout(() => {
29
- if (document.body.contains(wrapper)) {
30
- document.body.removeChild(wrapper)
31
- }
29
+ if (wrapper && wrapper.parentNode) {
30
+ wrapper.parentNode.removeChild(wrapper);
31
+ }
32
32
  });
33
33
  }, unmountDelay);
34
34
  }