UNPKG

ra-core

Version:

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

23 lines 844 B
import * as React from 'react'; import { ReactNode } from 'react'; import { ResourceContextValue } from './ResourceContext'; /** * Wrap children with a ResourceContext provider only if the value is defined. * * Allows a component to work outside of a resource context. * * @example * * import { OptionalResourceContextProvider, EditButton } from 'react-admin'; * * const Button = ({ resource }) => ( * <OptionalResourceContextProvider value={resource}> * <EditButton /> * </OptionalResourceContextProvider> * ); */ export declare const OptionalResourceContextProvider: ({ value, children, }: { value?: ResourceContextValue; children: ReactNode; }) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined; //# sourceMappingURL=OptionalResourceContextProvider.d.ts.map