UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

41 lines 1.45 kB
import * as React from 'react'; import { ReactNode } from 'react'; import { RaRecord } from '../../types'; import { EditControllerProps, EditControllerResult } from './useEditController'; /** * Call useEditController and put the value in a EditContext * * Base class for <Edit> components, without UI. * * Accepts any props accepted by useEditController: * - id: The record identifier * - resource: The resource * * @example // Custom edit layout * * const PostEdit = () => ( * <EditBase resource="posts"> * <Grid container> * <Grid item xs={8}> * <SimpleForm> * ... * </SimpleForm> * </Grid> * <Grid item xs={4}> * Edit instructions... * </Grid> * </Grid> * <div> * Post related links... * </div> * </EditBase> * ); */ export declare const EditBase: <RecordType extends RaRecord = any, ErrorType = Error>({ children, loading, offline, render, ...props }: EditBaseProps<RecordType, ErrorType>) => React.JSX.Element; export interface EditBaseProps<RecordType extends RaRecord = RaRecord, ErrorType = Error> extends EditControllerProps<RecordType, ErrorType> { children?: ReactNode; render?: (props: EditControllerResult<RecordType, ErrorType>) => ReactNode; loading?: ReactNode; offline?: ReactNode; } //# sourceMappingURL=EditBase.d.ts.map