diff --git a/.changeset/slimy-avocados-mix.md b/.changeset/slimy-avocados-mix.md new file mode 100644 index 00000000..dda7d30d --- /dev/null +++ b/.changeset/slimy-avocados-mix.md @@ -0,0 +1,5 @@ +--- +"@musma/react-utils": patch +--- + +fix: formState key가 겹치는 문제 diff --git a/packages/react-utils/src/hooks/useFormSearch.ts b/packages/react-utils/src/hooks/useFormSearch.ts index b1390b9a..9c89a71f 100644 --- a/packages/react-utils/src/hooks/useFormSearch.ts +++ b/packages/react-utils/src/hooks/useFormSearch.ts @@ -13,6 +13,7 @@ interface UseFormSearchProps { shouldRefetchOnReset?: boolean replace?: boolean initPageable?: Pageable + formStateKey?: string useFormProps: UseFormProps fetchAPI: () => void } @@ -21,11 +22,12 @@ export const useFormSearch = ({ shouldRefetchOnReset = true, replace, initPageable = INIT_PAGEABLE, + formStateKey = 'formState', useFormProps, fetchAPI, }: UseFormSearchProps) => { const [formState, setFormState] = useLocationState>({ - key: 'formState', + key: formStateKey, initialState: {}, })