@@ -39,16 +39,16 @@ export default function <TProps extends WithReportAndReportActionOrNotFoundProps
3939 WrappedComponent : ComponentType < TProps & RefAttributes < TRef > > ,
4040) : ComponentType < TProps & RefAttributes < TRef > > {
4141 function WithReportOrNotFound ( props : TProps , ref : ForwardedRef < TRef > ) {
42- const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ props . route . params . reportID } ` ) ;
42+ const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ props . route . params . reportID } ` , { canBeMissing : true } ) ;
4343 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
44- const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report ?. parentReportID || CONST . DEFAULT_NUMBER_ID } ` ) ;
45- const [ reportMetadata ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ props . route . params . reportID } ` ) ;
44+ const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report ?. parentReportID } ` , { canBeMissing : true } ) ;
45+ const [ reportMetadata ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ props . route . params . reportID } ` , { canBeMissing : true } ) ;
4646 const isLoadingReportData = useReportDataLoading ( false ) ;
47- const [ betas ] = useOnyx ( ONYXKEYS . BETAS ) ;
48- const [ policies ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY ) ;
49- const [ reportActions ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ props . route . params . reportID } ` , { canEvict : false } ) ;
47+ const [ betas ] = useOnyx ( ONYXKEYS . BETAS , { canBeMissing : false } ) ;
48+ const [ policies ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY , { canBeMissing : true } ) ;
49+ const [ reportActions ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ props . route . params . reportID } ` , { canEvict : false , canBeMissing : true } ) ;
5050 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
51- const [ parentReportAction ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ report ?. parentReportID || CONST . DEFAULT_NUMBER_ID } ` , {
51+ const [ parentReportAction ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ report ?. parentReportID } ` , {
5252 selector : ( parentReportActions ) => {
5353 const parentReportActionID = report ?. parentReportActionID ;
5454 if ( ! parentReportActionID ) {
@@ -57,6 +57,7 @@ export default function <TProps extends WithReportAndReportActionOrNotFoundProps
5757 return parentReportActions ?. [ parentReportActionID ] ?? null ;
5858 } ,
5959 canEvict : false ,
60+ canBeMissing : true ,
6061 } ) ;
6162 const linkedReportAction = useMemo ( ( ) => {
6263 let reportAction : OnyxEntry < OnyxTypes . ReportAction > = reportActions ?. [ `${ props . route . params . reportActionID } ` ] ;
0 commit comments