import * as React from 'react' ; import { ReactElement } from 'react' ; import PropTypes from 'prop-types' ; import { ShowContextProvider , ResourceContextProvider , useCheckMinimumRequiredProps , useShowController , } from 'ra-core' ; import { ShowProps } from '../types' ; import { ShowView } from './ShowView' ; example export const Show = ( props ) : ReactElement => { useCheckMinimumRequiredProps ( 'Show' , [ 'children' ] , props ) ; const controllerProps = useShowController ( props ) ; const body = ( < ShowContextProvider value = { controllerProps } > < ShowView { ... props } { ... controllerProps } /> < /ShowContextProvider>); return props . resource ? ( < ResourceContextProvider value = { props . resource } > { body } < /ResourceContextProvider>) : (body); } ; Show . propTypes = { actions : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . bool ] ) , aside : PropTypes . element , children : PropTypes . element , classes : PropTypes . object , className : PropTypes . string , hasCreate : PropTypes . bool , hasEdit : PropTypes . bool , hasList : PropTypes . bool , hasShow : PropTypes . bool , id : PropTypes . any . isRequired , resource : PropTypes . string , title : PropTypes . node , } ;