## Functions

| Function | Description |
|---|---|
| [FirebaseCrashlytics({ firebaseApp, crashlyticsOptions }, input)](https://firebase.google.com/docs/reference/js/crashlytics_react#firebasecrashlytics_097ca29) | ***(Public Preview)*** Registers event listeners for uncaught errors.This should be installed near the root of your application. Caught errors, including those implicitly caught by Error Boundaries, will not be captured by this component. |

## Interfaces

| Interface | Description |
|---|---|
| [Crashlytics](https://firebase.google.com/docs/reference/js/crashlytics_react.crashlytics#crashlytics_interface) | ***(Public Preview)*** An instance of the Firebase Crashlytics SDK.Do not create this instance directly. Instead, use [getCrashlytics()](https://firebase.google.com/docs/reference/js/crashlytics#getcrashlytics_a9d22a1). |
| [CrashlyticsFeature](https://firebase.google.com/docs/reference/js/crashlytics_react.crashlyticsfeature#crashlyticsfeature_interface) | **(EXPERIMENTAL)** An opaque feature plugin object returned by Crashlytics feature factory functions such as [breadcrumbs()](https://firebase.google.com/docs/reference/js/crashlytics#breadcrumbs). |
| [CrashlyticsOptions](https://firebase.google.com/docs/reference/js/crashlytics_react.crashlyticsoptions#crashlyticsoptions_interface) | ***(Public Preview)*** Options for initializing the Crashlytics service using [getCrashlytics()](https://firebase.google.com/docs/reference/js/crashlytics#getcrashlytics_a9d22a1). |

## function({ firebaseApp, crashlyticsOptions }, ...)

### FirebaseCrashlytics({ firebaseApp, crashlyticsOptions }, input)

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Registers event listeners for uncaught errors.

This should be installed near the root of your application. Caught errors, including those implicitly caught by Error Boundaries, will not be captured by this component.

**Signature:**

    export declare function FirebaseCrashlytics(input: {
        firebaseApp: FirebaseApp;
        crashlyticsOptions?: CrashlyticsOptions;
    }): null;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| { firebaseApp, crashlyticsOptions } | (not declared) |   |
| input | { firebaseApp: [FirebaseApp](https://firebase.google.com/docs/reference/js/app.firebaseapp#firebaseapp_interface); crashlyticsOptions?: [CrashlyticsOptions](https://firebase.google.com/docs/reference/js/crashlytics_react.crashlyticsoptions#crashlyticsoptions_interface); } |   |

**Returns:**

null

The default [Crashlytics](https://firebase.google.com/docs/reference/js/crashlytics_react.crashlytics#crashlytics_interface) instance for the given [FirebaseApp](https://firebase.google.com/docs/reference/js/app.firebaseapp#firebaseapp_interface).

### Example

    import { useEffect, useState } from "react";
    import { FirebaseCrashlytics } from "firebase/crashlytics/react";
    import { FirebaseApp, initializeApp } from "firebase/app";

    export default function MyApp() {
      const [app, setApp] = useState<FirebaseApp | null>(null);

      useEffect(() => {
        if (getApps().length === 0) {
          const newApp = initializeApp({...});
          setApp(newApp);
        } else {
          setApp(getApp());
        }
      }, []);

      return (
        <>
          {app && (
            <FirebaseCrashlytics
              firebaseApp={app}
              crashlyticsOptions={ {...} }
            />
          )}
          ...
        </>
      );
    }