react-query-firebase 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -59,7 +59,6 @@ export type FirebaseContextProviderEmulators = {
|
|
|
59
59
|
* @inline
|
|
60
60
|
*/
|
|
61
61
|
export type FirebaseContextProviderProps = PropsWithChildren & {
|
|
62
|
-
platform: "Web" | "ReactNative";
|
|
63
62
|
/**
|
|
64
63
|
* Defines configuration for firebase emulators
|
|
65
64
|
*/
|
|
@@ -67,7 +66,7 @@ export type FirebaseContextProviderProps = PropsWithChildren & {
|
|
|
67
66
|
/**
|
|
68
67
|
* Configuration options for Firebase initialization. {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}
|
|
69
68
|
*/
|
|
70
|
-
options
|
|
69
|
+
options?: ReactNativeFirebase.FirebaseAppOptions;
|
|
71
70
|
/**
|
|
72
71
|
* Flag indicating whether Firebase Auth should be enabled.
|
|
73
72
|
*/
|
|
@@ -27,7 +27,7 @@ import firebase from "@react-native-firebase/app";
|
|
|
27
27
|
* };
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
export const FirebaseContextProvider = ({ emulators,
|
|
30
|
+
export const FirebaseContextProvider = ({ emulators, children, authEnabled = true, firestoreEnabled = true, analyticsEnabled = true, consentSettings = {}, remoteConfigEnabled = true, remoteConfigSettings, remoteConfigDefaults = {}, firestoreSettings }) => {
|
|
31
31
|
const internalFirebase = useMemo(() => firebase, []);
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
setConsent(firebase.analytics(), {
|
|
@@ -67,11 +67,11 @@ export const FirebaseContextProvider = ({ emulators, options, children, authEnab
|
|
|
67
67
|
return null;
|
|
68
68
|
}, [emulators?.auth, authEnabled, internalFirebase]);
|
|
69
69
|
const internalAnalytics = useMemo(() => {
|
|
70
|
-
if (analyticsEnabled
|
|
70
|
+
if (analyticsEnabled) {
|
|
71
71
|
return internalFirebase.analytics();
|
|
72
72
|
}
|
|
73
73
|
return null;
|
|
74
|
-
}, [analyticsEnabled,
|
|
74
|
+
}, [analyticsEnabled, internalFirebase]);
|
|
75
75
|
const internalRemoteConfig = useMemo(() => {
|
|
76
76
|
if (remoteConfigEnabled) {
|
|
77
77
|
const localRemoteConfig = internalFirebase.remoteConfig();
|
|
@@ -67,7 +67,6 @@ export type FirebaseContextProviderEmulators = {
|
|
|
67
67
|
* @inline
|
|
68
68
|
*/
|
|
69
69
|
export type FirebaseContextProviderProps = PropsWithChildren & {
|
|
70
|
-
platform: "Web" | "ReactNative";
|
|
71
70
|
/**
|
|
72
71
|
* Defines configuration for firebase emulators
|
|
73
72
|
*/
|
|
@@ -75,7 +74,7 @@ export type FirebaseContextProviderProps = PropsWithChildren & {
|
|
|
75
74
|
/**
|
|
76
75
|
* Configuration options for Firebase initialization. {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}
|
|
77
76
|
*/
|
|
78
|
-
options
|
|
77
|
+
options?: ReactNativeFirebase.FirebaseAppOptions;
|
|
79
78
|
/**
|
|
80
79
|
* Flag indicating whether Firebase Auth should be enabled.
|
|
81
80
|
*/
|
|
@@ -151,7 +150,6 @@ export type FirebaseContextProviderProps = PropsWithChildren & {
|
|
|
151
150
|
*/
|
|
152
151
|
export const FirebaseContextProvider: React.FC<FirebaseContextProviderProps> = ({
|
|
153
152
|
emulators,
|
|
154
|
-
options,
|
|
155
153
|
children,
|
|
156
154
|
authEnabled = true,
|
|
157
155
|
firestoreEnabled = true,
|
|
@@ -211,11 +209,11 @@ export const FirebaseContextProvider: React.FC<FirebaseContextProviderProps> = (
|
|
|
211
209
|
}, [emulators?.auth, authEnabled, internalFirebase]);
|
|
212
210
|
|
|
213
211
|
const internalAnalytics = useMemo(() => {
|
|
214
|
-
if (analyticsEnabled
|
|
212
|
+
if (analyticsEnabled) {
|
|
215
213
|
return internalFirebase.analytics();
|
|
216
214
|
}
|
|
217
215
|
return null;
|
|
218
|
-
}, [analyticsEnabled,
|
|
216
|
+
}, [analyticsEnabled, internalFirebase]);
|
|
219
217
|
|
|
220
218
|
const internalRemoteConfig = useMemo(() => {
|
|
221
219
|
if (remoteConfigEnabled) {
|