diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 6daa15785921..5d0cb5ab9bf6 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -37,6 +37,7 @@ import ReportScreenContext from './ReportScreenContext'; import TaskHeaderActionButton from '../../components/TaskHeaderActionButton'; import DragAndDropProvider from '../../components/DragAndDrop/Provider'; import usePrevious from '../../hooks/usePrevious'; +import withCurrentReportID, {withCurrentReportIDPropTypes, withCurrentReportIDDefaultProps} from '../../components/withCurrentReportID'; const propTypes = { /** Navigation route context info provided by react navigation */ @@ -88,6 +89,7 @@ const propTypes = { ...windowDimensionsPropTypes, ...viewportOffsetTopPropTypes, + ...withCurrentReportIDPropTypes, }; const defaultProps = { @@ -102,6 +104,7 @@ const defaultProps = { policies: {}, accountManagerReportID: null, personalDetails: {}, + ...withCurrentReportIDDefaultProps, }; /** @@ -131,6 +134,7 @@ function ReportScreen({ viewportOffsetTop, isComposerFullSize, errors, + currentReportID, }) { const firstRenderRef = useRef(true); const flatListRef = useRef(); @@ -157,7 +161,7 @@ function ReportScreen({ const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`]; - const isTopMostReportId = Navigation.getTopmostReportId() === getReportID(route); + const isTopMostReportId = currentReportID === getReportID(route); let headerView = (