1 | {"version":3,"file":"use-with.esm.js","sources":["../src/index.js"],"sourcesContent":["import * as React from 'react';\n\nexport function useFC(render) {\n const renderRef = React.useRef();\n renderRef.current = render;\n\n return React.useRef(function RenderFunctionWrapper(restProps) {\n return renderRef.current(restProps);\n }).current;\n}\n\nexport default function useWith(Wrapped, props) {\n return useFC((restProps) => <Wrapped {...props} {...restProps} />);\n}\n"],"names":["useFC","render","renderRef","React","current","RenderFunctionWrapper","restProps","useWith","Wrapped","props","React.createElement"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEO,SAASA,KAAT,CAAeC,MAAf,EAAuB;AAC5B,MAAMC,SAAS,GAAGC,MAAA,EAAlB;AACAD,EAAAA,SAAS,CAACE,OAAV,GAAoBH,MAApB;AAEA,SAAOE,MAAA,CAAa,SAASE,qBAAT,CAA+BC,SAA/B,EAA0C;AAC5D,WAAOJ,SAAS,CAACE,OAAV,CAAkBE,SAAlB,CAAP;AACD,GAFM,EAEJF,OAFH;AAGD;AAEc,SAASG,OAAT,CAAiBC,OAAjB,EAA0BC,KAA1B,EAAiC;AAC9C,SAAOT,KAAK,CAAC,UAACM,SAAD;AAAA,wBAAeI,cAAC,OAAD,eAAaD,KAAb,EAAwBH,SAAxB,EAAf;AAAA,GAAD,CAAZ;AACD;;;;;"} |