From 9149053e2863804b12f684d8d3ddf26cc757b34b Mon Sep 17 00:00:00 2001 From: Valter Balegas Date: Tue, 29 Oct 2024 16:46:03 +0000 Subject: [PATCH] use only options that make the shape unique in sortedOptionsHash --- packages/react-hooks/src/react-hooks.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-hooks/src/react-hooks.tsx b/packages/react-hooks/src/react-hooks.tsx index dced20ea6e..308b5c4d0f 100644 --- a/packages/react-hooks/src/react-hooks.tsx +++ b/packages/react-hooks/src/react-hooks.tsx @@ -24,7 +24,14 @@ export async function preloadShape = Row>( } export function sortedOptionsHash(options: ShapeStreamOptions): string { - return JSON.stringify(options, Object.keys(options).sort()) + const hashOptions = { + url: options.url, + where: options.where, + columns: options.columns, + headers: options.headers, + } + + return JSON.stringify(hashOptions, Object.keys(hashOptions).sort()) } export function getShapeStream>(