@visactor/openinula-vtable
Version:
The openinula version of VTable
25 lines (20 loc) • 887 B
JavaScript
;
var __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.withTableInstance = void 0;
const openinula_1 = __importDefault(require("openinula")), React = openinula_1.default, TableContext = openinula_1.default.createContext(null);
function withTableInstance(Component) {
const Com = openinula_1.default.forwardRef(((props, ref) => React.createElement(TableContext.Consumer, null, (ctx => React.createElement(Component, Object.assign({
ref: ref,
table: ctx.table
}, props))))));
return Com.displayName = Component.name, Com;
}
TableContext.displayName = "TableContext", exports.withTableInstance = withTableInstance,
exports.default = TableContext;
//# sourceMappingURL=table.js.map