rc-notification
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -0,5 +1,4 @@ | ||
import type { CSSMotionProps } from 'rc-motion'; | ||
import * as React from 'react'; | ||
import type { Placement } from './Notifications'; | ||
import type { OpenConfig } from './Notifications'; | ||
import type { CSSMotionProps } from 'rc-motion'; | ||
import type { OpenConfig, Placement } from './Notifications'; | ||
type OptionalConfig = Partial<OpenConfig>; | ||
@@ -6,0 +5,0 @@ export interface NotificationConfig { |
@@ -114,3 +114,12 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
}); | ||
setTaskQueue([]); | ||
// React 17 will mix order of effect & setState in async | ||
// - open: setState[0] | ||
// - effect[0] | ||
// - open: setState[1] | ||
// - effect setState([]) * here will clean up [0, 1] in React 17 | ||
setTaskQueue(function (oriQueue) { | ||
return oriQueue.filter(function (task) { | ||
return !taskQueue.includes(task); | ||
}); | ||
}); | ||
} | ||
@@ -117,0 +126,0 @@ }, [taskQueue]); |
@@ -0,5 +1,4 @@ | ||
import type { CSSMotionProps } from 'rc-motion'; | ||
import * as React from 'react'; | ||
import type { Placement } from './Notifications'; | ||
import type { OpenConfig } from './Notifications'; | ||
import type { CSSMotionProps } from 'rc-motion'; | ||
import type { OpenConfig, Placement } from './Notifications'; | ||
type OptionalConfig = Partial<OpenConfig>; | ||
@@ -6,0 +5,0 @@ export interface NotificationConfig { |
@@ -124,3 +124,12 @@ "use strict"; | ||
}); | ||
setTaskQueue([]); | ||
// React 17 will mix order of effect & setState in async | ||
// - open: setState[0] | ||
// - effect[0] | ||
// - open: setState[1] | ||
// - effect setState([]) * here will clean up [0, 1] in React 17 | ||
setTaskQueue(function (oriQueue) { | ||
return oriQueue.filter(function (task) { | ||
return !taskQueue.includes(task); | ||
}); | ||
}); | ||
} | ||
@@ -127,0 +136,0 @@ }, [taskQueue]); |
{ | ||
"name": "rc-notification", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "notification ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52716
1016