UNPKG

@visactor/react-vtable

Version:

The react version of VTable

16 lines (12 loc) 500 B
import React from "react"; const TableContext = React.createContext(null); TableContext.displayName = "TableContext"; export function withTableInstance(Component) { const Com = React.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; //# sourceMappingURL=table.js.map