mock React.createContext

pull/11235/head
Wei Zhu 7 years ago
parent 47884320ef
commit ea42973ace

@ -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…
Cancel
Save