@react-firebase/firestore
Version:
Efficiently Render & mutate Firestore data in your react(or react-native) app.
36 lines (35 loc) • 1.33 kB
TypeScript
import * as React from "react";
import { FirestoreQuery, FirestoreProviderState } from "../types";
export declare type FirestoreMutationWithContextProps = FirestoreQuery & FirestoreProviderState & FirestoreMutationProps;
export declare type RunMutation = ((value: any, options?: {
merge: boolean;
}) => Promise<{
response: FirebaseFirestore.WriteResult;
path: string;
value: any;
type: "set" | "update" | "add" | "delete";
key: null | string;
}>);
export declare class FirestoreMutationWithContext extends React.Component<FirestoreMutationWithContextProps> {
createMutationRunner: () => (value: any, options?: {
merge: boolean;
} | undefined) => Promise<{
response: FirebaseFirestore.WriteResult;
path: string;
value: any;
type: "set" | "update" | "add" | "delete";
key: string | null;
}>;
shouldComponentUpdate(nextProps: FirestoreMutationWithContextProps): boolean;
render(): any;
}
export declare type FirestoreMutationProps = {
type: "set" | "update" | "add" | "delete";
path: string;
children: ({ runMutation }: {
runMutation: RunMutation;
}) => {};
};
export declare class FirestoreMutation extends React.Component<FirestoreMutationProps> {
render(): JSX.Element | null;
}