Functions
| Function | Description |
|---|---|
| FirebaseCrashlytics({ firebaseApp, crashlyticsOptions }, input) | (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 | (Public Preview) An instance of the Firebase Crashlytics SDK.Do not create this instance directly. Instead, use getCrashlytics(). |
| CrashlyticsFeature | (EXPERIMENTAL) An opaque feature plugin object returned by Crashlytics feature factory functions such as breadcrumbs(). |
| CrashlyticsOptions | (Public Preview) Options for initializing the Crashlytics service using getCrashlytics(). |
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; crashlyticsOptions?: CrashlyticsOptions; } |
Returns:
null
The default Crashlytics instance for the given FirebaseApp.
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={ {...} }
/>
)}
...
</>
);
}