mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
26 lines
442 B
JavaScript
26 lines
442 B
JavaScript
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
|
||
|
function withCurrentPage(WrappedComponent) {
|
||
|
function CurrentPage(props) {
|
||
|
const {
|
||
|
history
|
||
|
} = props;
|
||
|
|
||
|
return (
|
||
|
<WrappedComponent
|
||
|
{...props}
|
||
|
useCurrentPage={history.action === 'POP'}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
CurrentPage.propTypes = {
|
||
|
history: PropTypes.object.isRequired
|
||
|
};
|
||
|
|
||
|
return CurrentPage;
|
||
|
}
|
||
|
|
||
|
export default withCurrentPage;
|