Documents / @faasjs/react / FaasDataWrapperProps
Type Alias: FaasDataWrapperProps<Path>
FaasDataWrapperProps<
Path> =object
Props for the FaasDataWrapper render-prop component.
Type Parameters
Path
Path extends FaasActionPaths
Registered action path used to infer params and response data.
Methods
onDataChange()?
optionalonDataChange(args):void
Callback invoked whenever the resolved data value changes.
Parameters
args
FaasDataInjection<Path>
Returns
void
render()?
optionalrender(args):Element|Element[]
Render prop invoked with the resolved request state after the first load completes.
Parameters
args
FaasDataInjection<Path>
Returns
Element | Element[]
Properties
action
action:
Path
Action path to request.
baseUrl?
optionalbaseUrl?:BaseUrl
Base URL override used for this wrapper instance.
children?
optionalchildren?:React.ReactElement<Partial<FaasDataInjection<Path>>>
Child element cloned with injected request state after the first load completes.
data?
optionaldata?:FaasData<Path>
Controlled data value used instead of internal state.
fallback?
optionalfallback?:JSX.Element|false
Element rendered before the first successful load.
params?
optionalparams?:FaasParams<Path>
Params sent to the action.
polling?
optionalpolling?:number|false
Milliseconds to wait after each completed request before refreshing data in the background.
ref?
optionalref?:React.Ref<FaasDataWrapperRef<Path>>
Imperative ref exposing the current injected request state.
setData?
optionalsetData?:React.Dispatch<React.SetStateAction<FaasData<Path>>>
Controlled setter used instead of internal state.