Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Enable direct ad-hoc imports

オープン
#480 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
firebase, react, react-native, typescript

調査の方向性

まず、指定された React Native、Reactfire、Firebase のバージョンを使用して、新しい Expo アプリで IDBIndex エラーを再現し、次に Reactfire がプロバイダーをどのようにエクスポートしているかを調べます。FirebaseAppProvider のように、必要なコンポーネントだけをインポートでき、無関係な機能を読み込んだりエラーを発生させたりしない状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
3.6k
フォーク
403
平均マージ
5日 1時間
マージ済み PR(30日)
10

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FirebaseExtended/reactfire のほかの issue

FirebaseExtended/reactfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。