From 393c969f36865aeaa7515bae65cd6a705889794e Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Mon, 7 Oct 2024 12:30:06 +0200 Subject: [PATCH] fix(configure): ignore data attributes --- .../src/components/Configure.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/react-instantsearch-core/src/components/Configure.tsx b/packages/react-instantsearch-core/src/components/Configure.tsx index fd7de89fcb..bd9ca2da7f 100644 --- a/packages/react-instantsearch-core/src/components/Configure.tsx +++ b/packages/react-instantsearch-core/src/components/Configure.tsx @@ -5,7 +5,17 @@ import type { UseConfigureProps } from '../connectors/useConfigure'; export type ConfigureProps = UseConfigureProps; export function Configure(props: ConfigureProps) { - useConfigure({ ...props }, { $$widgetType: 'ais.configure' }); + useConfigure( + Object.keys(props).reduce((acc, key) => { + if (key.slice(0, 6) === 'data-') { + return acc; + } + // @ts-ignore + acc[key] = props[key]; + return acc; + }, {}), + { $$widgetType: 'ais.configure' } + ); return null; }