{"version":3,"file":"WithRef.mjs","names":["React","getDisplayName","hoistNonReactStatics","WithForwardRef","ForwardRef","Component","Wrapped","forwardRef","props","ref","createElement","_extends","defaultProps","forwardedRef","displayName"],"sources":["../../src/enhances/WithRef.tsx"],"sourcesContent":["import React from 'react';\nimport getDisplayName from '../getDisplayName';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nfunction WithForwardRef() {\n  return function ForwardRef<T extends React.ComponentType>(Component: T) {\n    const Wrapped = React.forwardRef((props, ref) => {\n      // @ts-ignore\n      return <Component {...(Component.defaultProps || {})} {...props} forwardedRef={ref} />;\n    });\n    Wrapped.displayName = getDisplayName(Component);\n    return hoistNonReactStatics(Wrapped, Component) as any;\n  };\n}\n\nexport default WithForwardRef;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAM,uBAAmB;AAC9C,OAAOC,oBAAoB,MAAM,yBAAyB;AAE1D,SAASC,cAAcA,CAAA,EAAG;EACxB,OAAO,SAASC,UAAUA,CAAgCC,SAAY,EAAE;IACtE,IAAMC,OAAO,gBAAGN,KAAK,CAACO,UAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;MAC/C;MACA,oBAAOT,KAAA,CAAAU,aAAA,CAACL,SAAS,EAAAM,QAAA,KAAMN,SAAS,CAACO,YAAY,IAAI,CAAC,CAAC,EAAOJ,KAAK;QAAEK,YAAY,EAAEJ;MAAI,GAAG;IACxF,CAAC,CAAC;IACFH,OAAO,CAACQ,WAAW,GAAGb,cAAc,CAACI,SAAS,CAAC;IAC/C,OAAOH,oBAAoB,CAACI,OAAO,EAAED,SAAS,CAAC;EACjD,CAAC;AACH;AAEA,eAAeF,cAAc"}