ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
22 lines (21 loc) • 432 B
text/typescript
import { useContext } from 'react';
import { SaveContext, SaveContextValue } from './SaveContext';
/**
* Get the save() function and its status
*
* Used in forms.
*
* @example
*
* const {
* save,
* saving
* } = useSaveContext();
*/
export const useSaveContext = <
PropsType extends SaveContextValue = SaveContextValue,
>(
_props?: PropsType
): SaveContextValue => {
return useContext(SaveContext);
};