mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +08:00
test: mock React.createRef
This commit is contained in:
parent
d87899784b
commit
c25e8de736
9
tests/__mocks__/react.js
vendored
9
tests/__mocks__/react.js
vendored
@ -8,4 +8,13 @@ if (!React.createContext) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!React.createRef) {
|
||||||
|
React.createRef = () => {
|
||||||
|
const ref = function setRef(node) {
|
||||||
|
ref.current = node;
|
||||||
|
};
|
||||||
|
return ref;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = React;
|
module.exports = React;
|
||||||
|
Loading…
Reference in New Issue
Block a user