mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 23:12:13 +00:00
higher order router context consumer component implemented
This commit is contained in:
parent
5606bd6f1e
commit
37549ad6f7
1 changed files with 12 additions and 0 deletions
12
src/app/withRouter.js
Normal file
12
src/app/withRouter.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import RouterContext from './routerContext';
|
||||
|
||||
const withRouter = (Component) => {
|
||||
return (props) => (
|
||||
<RouterContext.Consumer>
|
||||
{context => <Component {...props} {...context} />}
|
||||
</RouterContext.Consumer>
|
||||
);
|
||||
};
|
||||
|
||||
export default withRouter;
|
||||
Loading…
Reference in a new issue