mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
refactor: use Node.ELEMENT_NODE replace number (#52163)
* refactor: use Node.ELEMENT_NODE replace number * fix: fix * fix: fix * fix: fix * Update setup.ts Signed-off-by: lijianan <574980606@qq.com> * update --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
@@ -32,7 +32,7 @@ const Wave: React.FC<WaveProps> = (props) => {
|
||||
// ============================== Effect ==============================
|
||||
React.useEffect(() => {
|
||||
const node = containerRef.current;
|
||||
if (!node || node.nodeType !== 1 || disabled) {
|
||||
if (!node || node.nodeType !== window.Node.ELEMENT_NODE || disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ export function fillWindowEnv(window: Window | DOMWindow) {
|
||||
// https://github.com/yiminghe/css-animation/blob/a5986d73fd7dfce75665337f39b91483d63a4c8c/src/Event.js#L44
|
||||
win.AnimationEvent = win.AnimationEvent || win.Event;
|
||||
win.TransitionEvent = win.TransitionEvent || win.Event;
|
||||
|
||||
// ref: https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
|
||||
// ref: https://github.com/jsdom/jsdom/issues/2524
|
||||
Object.defineProperty(win, 'TextEncoder', { writable: true, value: util.TextEncoder });
|
||||
|
||||
Reference in New Issue
Block a user