mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
mock React.createContext
This commit is contained in:
parent
47884320ef
commit
ea42973ace
11
tests/__mocks__/react.js
vendored
Normal file
11
tests/__mocks__/react.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
const React = require.requireActual('react');
|
||||
|
||||
if (!React.createContext) {
|
||||
React.createContext = () => {
|
||||
const Provider = ({ children }) => children;
|
||||
const Consumer = ({ children }) => children();
|
||||
return { Provider, Consumer };
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = React;
|
Loading…
Reference in New Issue
Block a user