mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +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;
|
||||
|
Loading…
Reference in New Issue
Block a user