For ease of use, some consumers might want the app to handle all the logic internally (such as "active" or "current" resource id), in a controlled way.
One pattern might be to allow 2 props, say value and onValueChanged (like Radix does it), and if value exists when the component loads, we know the component will be uncontrolled.
For ease of use, some consumers might want the app to handle all the logic internally (such as "active" or "current" resource
id
), in acontrolled
way.One pattern might be to allow 2 props, say
value
andonValueChanged
(like Radix does it), and ifvalue
exists when the component loads, we know the component will beuncontrolled
.