1- import React , { useCallback } from 'react' ;
1+ import React from 'react' ;
22import type { FormOnyxValues } from '@components/Form/types' ;
33import { useSearchStateContext } from '@components/Search/SearchContext' ;
44import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' ;
@@ -34,7 +34,7 @@ function IOURequestStepCategoryCreate({
3434 report : reportReal ,
3535 reportDraft,
3636 route : {
37- params : { transactionID, action, iouType, reportID, backTo} ,
37+ params : { transactionID, action, iouType, reportID, reportActionID , backTo} ,
3838 } ,
3939 transaction,
4040} : IOURequestStepCategoryCreateProps ) {
@@ -87,8 +87,7 @@ function IOURequestStepCategoryCreate({
8787 parentReportAction : setupCategoriesAndTagsParentReportAction ,
8888 } = useOnboardingTaskInformation ( CONST . ONBOARDING_TASK_TYPE . SETUP_CATEGORIES_AND_TAGS ) ;
8989
90- const createCategory = useCallback (
91- ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . WORKSPACE_CATEGORY_FORM > ) => {
90+ const createCategory = ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . WORKSPACE_CATEGORY_FORM > ) => {
9291 const categoryName = values . categoryName . trim ( ) ;
9392
9493 if ( ! policyID ) {
@@ -151,42 +150,7 @@ function IOURequestStepCategoryCreate({
151150 return ;
152151 }
153152 Navigation . goBack ( backTo ) ;
154- } ,
155- [
156- action ,
157- backTo ,
158- currentSearchHash ,
159- currentUserPersonalDetails . accountID ,
160- currentUserPersonalDetails . login ,
161- hasOutstandingChildTask ,
162- isASAPSubmitBetaEnabled ,
163- isEditing ,
164- isEditingSplit ,
165- isSetupCategoriesAndTagsTaskParentReportArchived ,
166- isSetupCategoryTaskParentReportArchived ,
167- iouType ,
168- parentReport ,
169- parentReportAction ,
170- parentReportNextStep ,
171- policy ,
172- policyCategories ,
173- policyHasTags ,
174- policyID ,
175- policyRecentlyUsedCategories ,
176- policyTags ,
177- report ,
178- reportID ,
179- setupCategoriesAndTagsHasOutstandingChildTask ,
180- setupCategoriesAndTagsParentReportAction ,
181- setupCategoriesAndTagsTaskParentReport ,
182- setupCategoriesAndTagsTaskReport ,
183- setupCategoryTaskParentReport ,
184- setupCategoryTaskReport ,
185- splitDraftTransaction ,
186- transaction ,
187- transactionID ,
188- ] ,
189- ) ;
153+ } ;
190154
191155 return (
192156 < AccessOrNotFoundWrapper
@@ -196,7 +160,7 @@ function IOURequestStepCategoryCreate({
196160 >
197161 < StepScreenWrapper
198162 headerTitle = { translate ( 'workspace.categories.addCategory' ) }
199- onBackButtonPress = { ( ) => Navigation . goBack ( ROUTES . MONEY_REQUEST_STEP_CATEGORY . getRoute ( action , iouType , transactionID , reportID , backTo ) ) }
163+ onBackButtonPress = { ( ) => Navigation . goBack ( ROUTES . MONEY_REQUEST_STEP_CATEGORY . getRoute ( action , iouType , transactionID , reportID , backTo , reportActionID ) ) }
200164 shouldShowWrapper
201165 testID = "IOURequestStepCategoryCreate"
202166 >
0 commit comments