UNPKG

@lesnoypudge/utils-react

Version:

lesnoypudge's utils-react

16 lines (15 loc) 466 B
import { renderFunction } from "../renderFunction/renderFunction.js"; import { withDisplayName } from "../withDisplayName/withDisplayName.js"; const createHookComponent = (displayName, hookFactory) => { return withDisplayName(displayName, ({ children, args }) => { const hookValue = hookFactory(...args ?? []); return renderFunction(children, hookValue); }); }; export { createHookComponent }; //# sourceMappingURL=createHookComponent.js.map