ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
13 lines (9 loc) • 459 B
text/typescript
import { createContext, useContext } from 'react';
import { type RaRecord } from '../types';
export type DataTableDataContextProps<RecordType extends RaRecord = any> =
| RecordType[]
| undefined;
export const DataTableDataContext =
createContext<DataTableDataContextProps>(undefined);
export const useDataTableDataContext = <RecordType extends RaRecord = any>() =>
useContext(DataTableDataContext) as DataTableDataContextProps<RecordType>;