@react-md/table
Version:
Create responsive data tables and accessible fixed tables
21 lines • 716 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StickyTableProvider = exports.useSticky = void 0;
var react_1 = require("react");
var context = (0, react_1.createContext)(false);
/**
* A quick way to conditionally inherit the sticky context within a table. If
* the sticky prop was defined and a boolean, it will be used. Otherwise the
* inherited context value will be used.
* @internal
*/
function useSticky(sticky) {
var isSticky = (0, react_1.useContext)(context);
return typeof sticky !== "undefined" ? !!sticky : isSticky;
}
exports.useSticky = useSticky;
/**
* @internal
*/
exports.StickyTableProvider = context.Provider;
//# sourceMappingURL=sticky.js.map