ant-design/tests/__mocks__/react.js
2019-04-16 12:18:39 +08:00

19 lines
396 B
JavaScript

import createReactContext from '@ant-design/create-react-context/lib/implementation';
const React = require.requireActual('react');
if (!React.createContext) {
React.createContext = createReactContext;
}
if (!React.createRef) {
React.createRef = () => {
const ref = function setRef(node) {
ref.current = node;
};
return ref;
};
}
Object.assign(module.exports, React);