API reference
The React integration builds on top of the core JavaScript client. For the base API reference (method chaining, configuration, using the Flare class directly), see the JavaScript API reference.
Exports
import { FlareErrorBoundary, flareReactErrorHandler } from '@flareapp/react';
| Export | Description |
|---|---|
FlareErrorBoundary |
React error boundary component that catches rendering errors and reports them to Flare. See Error boundary. |
flareReactErrorHandler |
Factory function that returns a callback compatible with React 19's createRoot/hydrateRoot error callbacks and the react-error-boundary library. See Error handler. |
TypeScript
The @flareapp/react package ships with full TypeScript support. The following types are exported:
import type {
FlareErrorBoundaryProps,
FlareErrorBoundaryFallbackProps,
FlareErrorBoundaryState,
FlareReactErrorHandlerCallback,
FlareReactErrorHandlerOptions,
FlareReactContext,
ComponentStackFrame,
} from '@flareapp/react';
| Type | Description |
|---|---|
FlareErrorBoundaryProps |
Props accepted by the FlareErrorBoundary component. |
FlareErrorBoundaryFallbackProps |
Props passed to the fallback render function (error, componentStack, resetErrorBoundary). |
FlareErrorBoundaryState |
Internal state of the error boundary (error, componentStack). |
FlareReactErrorHandlerCallback |
The callback signature returned by flareReactErrorHandler(): (error: unknown, errorInfo: { componentStack?: string }) => void. |
FlareReactErrorHandlerOptions |
Options accepted by flareReactErrorHandler() (beforeEvaluate, beforeSubmit, afterSubmit). |
FlareReactContext |
Shape of the context argument passed to beforeSubmit / afterSubmit ({ react: { componentStack, componentStackFrames } }). |
ComponentStackFrame |
A single parsed frame from context.react.componentStackFrames (component, file, line, column). |
- On this page
- Exports
- TypeScript