import { FunctionComponent } from 'react' ; import { useQuery } from './useQuery' ; interface ChildrenFuncParams { data ? : any ; total ? : number ; loading : boolean ; loaded : boolean ; error ? : any ; } export interface QueryProps { children : ( params : ChildrenFuncParams ) => JSX . Element ; type : string ; resource ? : string ; payload ? : any ; options ? : any ; } param { Function } children param { string } type param { string } resource param { Object } payload param options param { string } options . action param { Function } options . onSuccess param { Function } options . onFailure example example const Query = ( { children , type , resource , payload , options = { onSuccess : undefined } , } ) => children ( useQuery ( { type , resource , payload } , { ... options , withDeclarativeSideEffectsSupport : true } ) ) ; export default Query ;