import React from 'react';

export const hookToHoc = (hookFn) => {
  return (Component) => (props) => {
    const hookProps = hookFn(props);
    return <Component {...props} {...hookProps}/>;
  }
}

@@ -21,16 +21,306 @@
 eact';%0A%0A
+// Given a hook function, return a higher-order component which calls it and%0A// adds the result as extra props. If componentPropsToHookParams is given, calls%0A// it on the component's props and passes the result as an argument to hookFn;%0A// otherwise hookFn is assumed to take no arguments.%0A
 export c
@@ -343,16 +343,44 @@
  (hookFn
+, componentPropsToHookParams
 ) =%3E %7B%0A 
@@ -441,20 +441,87 @@
 s = 
+componentPropsToHookProps ? hookFn(componentPropsToHookParams(props)) : 
 hookFn(
-props
 );%0A 

Address code review comments