diff --git a/tests/__mocks__/react.js b/tests/__mocks__/react.js index b5a0a7321e..dc8f3830c2 100644 --- a/tests/__mocks__/react.js +++ b/tests/__mocks__/react.js @@ -1,11 +1,9 @@ +import createReactContext from 'create-react-context/lib/implementation'; + const React = require.requireActual('react'); if (!React.createContext) { - React.createContext = () => { - const Provider = ({ children }) => children; - const Consumer = ({ children }) => children(); - return { Provider, Consumer }; - }; + React.createContext = createReactContext; } if (!React.createRef) {