Flare by Spatie
    • Error Tracking
    • Performance Monitoring
    • Logging Coming soon
  • Pricing
  • Docs
  • Insights
  • Changelog
  • Back to Flare ⌘↵ Shortcut: Command or Control Enter
  • Sign in
  • Try Flare for free
  • Error Tracking
  • Performance Monitoring
  • Logging Coming soon
  • Pricing
  • Docs
  • Insights
  • Changelog
    • Back to Flare ⌘↵ Shortcut: Command or Control Enter
    • Try Flare for free
    • Sign in
Flare Flare Laravel Laravel PHP PHP JavaScript JavaScript React React Vue Vue Protocol Protocol
  • General
  • Installation
  • Resolving bundled code
  • API reference
  • Errors
  • Error boundary
  • Error handler
  • Reporting errors
  • Client hooks
  • Data Collection
  • Adding custom context
  • Adding glows

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).
Resolving bundled code Error boundary
  • On this page
  • Exports
  • TypeScript

Catch errors and fix slowdowns with Flare, the full-stack application monitoring platform for Laravel, PHP & JavaScript.

  • Platform
  • Error Tracking
  • Performance Monitoring
  • Pricing
  • Support
  • Resources
  • Insights
  • Newsletter
  • Changelog
  • Documentation
  • Affiliate program
  • uptime status badge Service status
  • Terms of use
  • DPA
  • Privacy & cookie Policy
Made in by
Flare