Closed creativecreature closed 1 year ago
Reacts useRef allows you to supply a default value. When using useFacetRef it can get a little verbose to have to check it against NO_VALUE.
useRef
useFacetRef
NO_VALUE
const mockFacet: Facet<string> .... const ref = useFacetRef(mockFacet) // MutableRefObject<Option<string>>
const mockFacet: Facet<string> .... const ref = useFacetRef(mockFacet, 'fallback') // MutableRefObject<string>
Overview
Reacts
useRef
allows you to supply a default value. When usinguseFacetRef
it can get a little verbose to have to check it againstNO_VALUE
.