@nardole/firebase-react 0.1.1 → 0.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/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useRef, useMemo, useContext } from "react";
1
+ import React, { useContext, useRef, useMemo } from "react";
2
2
  import { firebaseService } from "@nardole/firebase-core";
3
3
  const FirebaseAppContext = React.createContext(void 0);
4
4
  function FirebaseAppProvider({
@@ -13,10 +13,11 @@ function FirebaseAppProvider({
13
13
  enableFirestore,
14
14
  children
15
15
  }) {
16
+ const firebase = useContext(FirebaseAppContext);
16
17
  const optionsRef = useRef(void 0);
17
18
  const nameRef = useRef(void 0);
18
19
  const value = useMemo(() => {
19
- if (optionsRef.current !== options || nameRef.current !== name) {
20
+ if (!firebase && (optionsRef.current !== options || nameRef.current !== name)) {
20
21
  firebaseService.init(options, name, true);
21
22
  }
22
23
  optionsRef.current = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nardole/firebase-react",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "keywords": [
5
5
  "firebase",
6
6
  "react",
File without changes