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 +8 -0
- package/lib/createConfirmation.js +2 -2
- package/package.json +1 -1
- package/src/createConfirmation.js +3 -3
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 (
|
|
40
|
-
|
|
39
|
+
if (wrapper && wrapper.parentNode) {
|
|
40
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}, unmountDelay);
|
package/package.json
CHANGED
|
@@ -26,9 +26,9 @@ const createConfirmation = (Component, unmountDelay = 1000, mountingNode) => {
|
|
|
26
26
|
setTimeout(() => {
|
|
27
27
|
root.unmount();
|
|
28
28
|
setTimeout(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if (wrapper && wrapper.parentNode) {
|
|
30
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
31
|
+
}
|
|
32
32
|
});
|
|
33
33
|
}, unmountDelay);
|
|
34
34
|
}
|