Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Enable direct ad-hoc imports

Đang mở
#480 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
firebase, react, react-native, typescript

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lỗi IDBIndex trong một ứng dụng Expo mới bằng cách sử dụng các phiên bản React Native, Reactfire và Firebase được liệt kê, sau đó kiểm tra cách Reactfire export các provider của mình. Công việc được xem là hoàn tất khi người dùng có thể chỉ import component cần thiết, chẳng hạn như FirebaseAppProvider, mà không tải các chức năng không liên quan hoặc kích hoạt lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

v5

Can't find variable: IDBIndex when setting up on Expo

I used the same hierarchy I had working on the web. I am not using performance or analytics, so I think all of the underlying components should work.

But, I believe that since there isn't a way (that I can tell) to import only specific components, I end up with an error as if I were importing performance package.

import React from 'react'
import { getAuth, connectAuthEmulator } from 'firebase/auth'
import { getFunctions, connectFunctionsEmulator } from "firebase/functions"
import { getStorage, connectStorageEmulator } from "firebase/storage"
import { getFirestore, connectFirestoreEmulator } from "firebase/firestore";
import { FirebaseAppProvider, useFirebaseApp, AuthProvider, StorageProvider, FirestoreProvider } from 'reactfire';

function FirebaseComponents({ children }) {
  const app = useFirebaseApp() // a parent component contains a `FirebaseAppProvider`
  const auth = getAuth(app)
  const functions = getFunctions(app)
  const firestoreInstance = getFirestore(app)
  const storage = getStorage(app)

  return (
    <AuthProvider sdk={auth}>
      <FirestoreProvider sdk={firestoreInstance}>
        <StorageProvider sdk={storage}>
            {children}
        </StorageProvider>
      </FirestoreProvider>
    </AuthProvider>
  );
}

function AllFirebaseComponents({ children, fire }) {
    return (
        <FirebaseAppProvider firebaseApp={fire} >
          <FirebaseComponents>
            {children}
          </FirebaseComponents>
        </FirebaseAppProvider>
    )
  }

export default AllFirebaseComponents
Version info

"react": "^17.0.2",
"react-native": "~0.63.4",
"reactfire": "^4.2.0",
"firebase": "^9.0.1",

Test case

TBU, will try to get one of these

Steps to reproduce

Start a new expo app, attempt to use reactfire. Get error mentioned above.

Expected behavior

Be able to import only the components needed, ex:

import FirebaseAppProvider from 'reactfire/FirebaseAppProvider';
Actual behavior

I get the error mentioned above which I think comes from the performance stuff

Ngôn ngữ chính
TypeScript
Star
3.6k
Fork
403
Merge trung bình
5 ngày 1 giờ
Pull request đã merge (30 ngày)
10

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FirebaseExtended/reactfire

Tất cả issue của FirebaseExtended/reactfire

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.