react-admin-firebase icon indicating copy to clipboard operation
react-admin-firebase copied to clipboard

No data on first load

Open crevulus opened this issue 3 years ago • 2 comments

I see a "No {collection-name} yet" message on first load, but if I refresh or switch tabs then the data loads.

See problem in attached gif.

Oct-25-2021 12-08-15

recreate

  1. Start a new project in line with the demo on npm and the RA tutorial.
  2. Add FB config.
  3. Downgrade FB version to 7.24.0 because of #207.
  4. yarn start to run the app, then see problem.

My code:

import React from "react";
import { Admin, Resource, ListGuesser } from "react-admin";
import { FirebaseDataProvider, RAFirebaseOptions } from "react-admin-firebase";

import firebaseConfig from "./firebaseConfig.js";

const options: RAFirebaseOptions = {
  logging: true,
  watch: ["blackTeas", "users"],
};

const dataProvider = FirebaseDataProvider(firebaseConfig, options);

function App() {
  return (
    <Admin dataProvider={dataProvider}>
      <Resource name="blackTeas" list={ListGuesser} />
      <Resource name="users" list={ListGuesser} />
    </Admin>
  );
}

export default App;

Here's I'm using ListGuesser, but it's the same with an actual component.

crevulus avatar Oct 25 '21 10:10 crevulus

Did you find a solution?

John-Oula avatar Apr 10 '22 02:04 John-Oula

@John-Oula this should be fixed now. What version of react-admin-firebase and firebase are you using?

benwinding avatar Apr 10 '22 08:04 benwinding