@react-md/table
Version:
Create responsive data tables and accessible fixed tables
17 lines • 553 B
JavaScript
import { createContext, useContext } from "react";
var context = 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
*/
export function useSticky(sticky) {
var isSticky = useContext(context);
return typeof sticky !== "undefined" ? !!sticky : isSticky;
}
/**
* @internal
*/
export var StickyTableProvider = context.Provider;
//# sourceMappingURL=sticky.js.map