Answer the question
In order to leave comments, you need to log in
How to correctly set the structure of the state and update it with different choices?
I have filter components -> priceFilter, colorFilter
Each of the bottom has different content. I need to set what value is selected and display them at the bottom. One of the multiple selection components, the other single selection.
I chose the following state structure:
{
{
id: 'refinementColor', // id самого фильтра
value: [] // есть single selection то тут ""
}
}
{
{
id: 'refinementColor', // id самого фильтра
value: [] // есть single selection то тут ""
}
}
{
{
id: 'refinementColor',
value: []
},
{
id: "price",
value: "900$ - 200$"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question