Attach any Hydrateless enhancer to the element in ref for the lifetime of a
component. Returns a ref holding the enhancer's imperative API (for example
setValue/setOpen), or null while nothing is enhanced. The instance is
destroyed on unmount, and destroyed and re-created when deps change, so no
listeners leak across renders.
Function-valued options (onValueChange, onOpenChange, ...) always call
the handler from the latest render, so they never need to appear in deps.
Other options are read when the enhancer is created; list the ones that
should trigger re-enhancement in deps.
Attach any Hydrateless enhancer to the element in
reffor the lifetime of a component. Returns a ref holding the enhancer's imperative API (for examplesetValue/setOpen), ornullwhile nothing is enhanced. The instance is destroyed on unmount, and destroyed and re-created whendepschange, so no listeners leak across renders.Function-valued options (
onValueChange,onOpenChange, ...) always call the handler from the latest render, so they never need to appear indeps. Other options are read when the enhancer is created; list the ones that should trigger re-enhancement indeps.