UNPKG

@bedrock-layout/use-forwarded-ref

Version:

bedrock-layout useForwardedRef

2 lines (1 loc) 587 B
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@bedrock-layout/use-stateful-ref"),require("react")):typeof define=="function"&&define.amd?define(["exports","@bedrock-layout/use-stateful-ref","react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.useForwardedRef={},e.useStatefulRef,e.React))})(this,function(e,t,u){"use strict";function r(n,s={isStateful:!0}){const o=t.useStatefulRef(),i=u.useRef(),f=s.isStateful?o:i;return u.useImperativeHandle(n,()=>f.current),f}e.useForwardedRef=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});