Skip to content

Commit c3219de

Browse files
committed
Use query input as queryKey for useQuery
1 parent d6a99e7 commit c3219de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,17 @@ export const FormContextProvider = <T extends ConfigurableProps>({
129129
configuredProps,
130130
dynamicPropsId: dynamicProps?.id,
131131
};
132-
const queryKey = reloadPropIdx ? `dynamicProps:${reloadPropIdx}` : "dynamicProps"
132+
const queryKeyInput = {
133+
...componentReloadPropsInput,
134+
}
135+
133136
const {
134137
isFetching: dynamicPropsQueryIsFetching,
135138
// TODO error
136139
} = useQuery({
137140
queryKey: [
138-
queryKey
141+
"dynamicProps",
142+
queryKeyInput
139143
],
140144
queryFn: async () => {
141145
const { dynamicProps } = await client.componentReloadProps(componentReloadPropsInput);

0 commit comments

Comments
 (0)