diff --git a/src/app/historyContext.js b/src/app/historyContext.js new file mode 100644 index 000000000..feb06541f --- /dev/null +++ b/src/app/historyContext.js @@ -0,0 +1,5 @@ +import React from 'react'; + +const HistoryContext = React.createContext(); + +export default HistoryContext; diff --git a/src/app/routerContext.js b/src/app/routerContext.js deleted file mode 100644 index 1a31b1bdf..000000000 --- a/src/app/routerContext.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; - -const RouterContext = React.createContext(); - -export default RouterContext; diff --git a/src/app/withHistory.js b/src/app/withHistory.js new file mode 100644 index 000000000..90e4e1e81 --- /dev/null +++ b/src/app/withHistory.js @@ -0,0 +1,14 @@ +import React from 'react'; +import HistoryContext from './historyContext'; + +const withHistory = (Component) => { + return function WithHistory(props) { + return ( + + {context => } + + ); + }; +}; + +export default withHistory; diff --git a/src/app/withRouter.js b/src/app/withRouter.js deleted file mode 100644 index d82c9b676..000000000 --- a/src/app/withRouter.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import RouterContext from './routerContext'; - -const withRouter = (Component) => { - return (props) => ( - - {context => } - - ); -}; - -export default withRouter;