Feature request: return a ref from useFacetState
xaviervia opened this issue · 0 comments
xaviervia commented
Example:
const [valueFacet, setValue, valueRef] = useFacetState(0)
This would be equivalent to doing
const [valueFacet, setValue] = useFacetState(0)
const valueRef = useFacetRef(valueFacet)
But then there would be no need for useFacetRef
do use a useFacetEffect
, instead updating the ref could happen in the setter. This would help with performance, and make the type of the ref cleaner (since it can't be NO_VALUE
in this case)