Kirill Pakhomov
Kirill Pakhomov

Reputation: 87

How to trigger re-render on Semantic's dropdown component?

I have products component which passes props to filters component thus filters component renders semantic-ui dropdowns filled up with passed props.

enter image description here

After change selection on some filter semantic sets state of dropdown to selected value.

enter image description here

"Clear all" button updates products and filters components but leaves dropdowns untouched as their state remains untouched. I've tried to pass into dropdowns some new custom props but didn't succeed.

Filters being rendered like so - enter image description here

So the question is - how to unset value of semantic's dropdown?

Upvotes: 0

Views: 755

Answers (1)

Mosè Raguzzini
Mosè Raguzzini

Reputation: 15841

as I can see value prop on your dropDown isn't set. Without this prop set the component is uncontrolled, if you add this props instead, changing the state reference of the value will also reset your select.

Upvotes: 1

Related Questions