// hoc.js
function WithConsole(WrappedComponent) {
  return
  
  };
}
export default WithConsole;

// 使用时
import hoc from "./hoc.js";
const EnhancedCom = hoc(BaseComponent);

具体Demo可看:https://codesandbox.io/s/712pmvqy66