Skip to content

Commit

Permalink
fix: formStateKey를 Props로 받을 수 있도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave352 committed Oct 30, 2023
1 parent 26c3127 commit bfb261d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-avocados-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@musma/react-utils": patch
---

fix: formState key가 겹치는 문제
4 changes: 3 additions & 1 deletion packages/react-utils/src/hooks/useFormSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface UseFormSearchProps<T extends object> {
shouldRefetchOnReset?: boolean
replace?: boolean
initPageable?: Pageable
formStateKey?: string
useFormProps: UseFormProps<T>
fetchAPI: () => void
}
Expand All @@ -21,11 +22,12 @@ export const useFormSearch = <T extends object>({
shouldRefetchOnReset = true,
replace,
initPageable = INIT_PAGEABLE,
formStateKey = 'formState',
useFormProps,
fetchAPI,
}: UseFormSearchProps<T>) => {
const [formState, setFormState] = useLocationState<FormState<T>>({
key: 'formState',
key: formStateKey,
initialState: {},
})

Expand Down

0 comments on commit bfb261d

Please sign in to comment.