@faasjs/react
v3.7.1
Published
React plugin for FaasJS.
Downloads
2,418
Readme
@faasjs/react
React plugin for FaasJS.
If you use SWR or React Query / TanStack Query, please use @faasjs/browser
directly.
Features
- Support FaasJS Request Specifications.
- Support global and per-request configurations.
- Support React Server Actions.
- Compatible with why-did-you-render.
- Additional React functions:
- Utils:
- equal: Compare two values for deep equality.
- useEqualMemoize: Memoize a value with deep equality.
- useEqualEffect: Run an effect with deep equality.
- useEqualMemo: Memoize a value with deep equality.
- useEqualCallback: Memoize a callback with deep equality.
- useConstant: Create a constant value with hooks.
- createSplittingContext: Create a context for code splitting.
- splittingState: Create a splitting states.
- OptionalWrapper: Render a component optionally.
- ErrorBoundary: Catch errors in the component tree.
- Fetch Data:
- faas: Fetch data from FaasJS.
- useFaas: Fetch data from FaasJS with hooks.
- FaasDataWrapper: Fetch data from FaasJS with a wrapper component.
- withFaasData: Fetch data from FaasJS using a higher-order component (HOC).
- Utils:
Install
npm install @faasjs/react react
Functions
- createSplittingContext
- equal
- faas
- FaasDataWrapper
- FaasReactClient
- Form
- FormContextProvider
- FormItem
- getClient
- OptionalWrapper
- useConstant
- useEqualCallback
- useEqualEffect
- useEqualMemo
- useEqualMemoize
- useFaas
- useFormContext
- usePrevious
- useSplittingState
- validValues
- withFaasData
Classes
Interfaces
Type Aliases
- ErrorChildrenProps
- FaasAction
- FaasData
- FaasDataInjection
- FaasDataWrapperProps
- FaasParams
- FaasReactClientInstance
- FaasReactClientOptions
- FormButtonElementProps
- FormContextProps
- FormDefaultRulesOptions
- FormElementTypes
- FormInputElementProps
- FormItemName
- FormItemProps
- FormLabelElementProps
- FormLang
- FormProps
- FormRule
- FormRules
- InferFormRulesOptions
- OnError
- OptionalWrapperProps
- Options
- ResponseHeaders
- useFaasOptions