UNPKG

@visactor/openinula-vtable

Version:

The openinula version of VTable

15 lines (11 loc) 485 B
import Inula from "openinula"; const React = Inula, TableContext = Inula.createContext(null); TableContext.displayName = "TableContext"; export function withTableInstance(Component) { const Com = Inula.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; } export default TableContext;