You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/frontend/src/Components/withCurrentPage.js

26 lines
442 B

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;