Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit a1fa596

Browse files
authored
fix(hooks): clear current refinement for hierarchical menu not working (#3241)
1 parent acf33c1 commit a1fa596

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

examples/hooks/App.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,13 @@ export function App() {
117117
<CurrentRefinements
118118
transformItems={(items) =>
119119
items.map((item) => {
120-
const attribute = item.attribute.startsWith(
121-
'hierarchicalCategories'
122-
)
120+
const label = item.label.startsWith('hierarchicalCategories')
123121
? 'Hierarchy'
124-
: item.attribute;
122+
: item.label;
125123

126124
return {
127125
...item,
128-
attribute,
129-
refinements: item.refinements.map((refinement) => ({
130-
...refinement,
131-
attribute,
132-
})),
126+
attribute: label,
133127
};
134128
})
135129
}

0 commit comments

Comments
 (0)