FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

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()?

optional onDataChange(args): void

Callback invoked whenever the resolved data value changes.

Parameters

args

FaasDataInjection<Path>

Returns

void

render()?

optional render(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?

optional baseUrl?: BaseUrl

Base URL override used for this wrapper instance.

children?

optional children?: React.ReactElement<Partial<FaasDataInjection<Path>>>

Child element cloned with injected request state after the first load completes.

data?

optional data?: FaasData<Path>

Controlled data value used instead of internal state.

fallback?

optional fallback?: JSX.Element | false

Element rendered before the first successful load.

params?

optional params?: FaasParams<Path>

Params sent to the action.

polling?

optional polling?: number | false

Milliseconds to wait after each completed request before refreshing data in the background.

ref?

optional ref?: React.Ref<FaasDataWrapperRef<Path>>

Imperative ref exposing the current injected request state.

setData?

optional setData?: React.Dispatch<React.SetStateAction<FaasData<Path>>>

Controlled setter used instead of internal state.