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 • 775 B
TypeScript
import * as React from 'react';
import { ReactElement } 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: ReactElement;
}) => React.JSX.Element;
//# sourceMappingURL=OptionalResourceContextProvider.d.ts.map