2021-11-10
2483
#firebase#react#redux
Yusuff Faruq
17529
Nov 10, 2021 â‹… 8 min read

Getting started with react-redux-firebase

Yusuff Faruq Frontend web developer and anime lover from Nigeria.

Recent posts:

Rust logo over black marble background.

Handling memory leaks in Rust

Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.

Ukeje Goodness
Nov 20, 2024 â‹… 4 min read
Robot pretending to be a person.

Using curl-impersonate in Node.js to avoid blocks

Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.

Antonello Zanini
Nov 20, 2024 â‹… 13 min read
Solving Eventual Consistency In Frontend

Solving eventual consistency in frontend

Handle frontend data discrepancies with eventual consistency using WebSockets, Docker Compose, and practical code examples.

Kayode Adeniyi
Nov 19, 2024 â‹… 6 min read
How To Use Lazy Initialization Pattern With Rust 1.80

How to use the lazy initialization pattern with Rust 1.80

Efficient initializing is crucial to smooth-running websites. One way to optimize that process is through lazy initialization in Rust 1.80.

Yashodhan Joshi
Nov 18, 2024 â‹… 5 min read
View all posts

5 Replies to "Getting started with react-redux-firebase"

  1. how does your live app work? When i press the button it authenticated me but nothing happened

  2. Thanks for the great starter. Noticed a small bug. Because you are moving `isDone` to local state (`isTodoItemDone`) it is not updated/rerendered when `firestore` receives a change from the `todos` listener so when you use that to set the `input` to `checked`, it doesn’t update the UI when it is marked complete in a different window/app instance.

    I’ve fixed it by updating the state in an `effect`:

    “`
    const [isTodoItemDone, setTodoItemDone] = useState(isDone);
    useEffect(() => {
    setTodoItemDone(isDone);
    }, [isDone]);
    “`

  3. If you look at the console you can see that google authentication is not set up properly. In the author’s account he needs to allow registration from this domain.

  4. Guys,

    I’m new to redux world, also firestore. I am building an application and we are already using the react-redux-firebase, an i get the point of using it since i want access auth in all parts of my app.

    But when comes to the other collections i don’t see the reason to keep all of them inside my store, as example i have a collection companies, and i have a specific page to look a them, edit and add new.

    I don’t need to keep them available in any other component, to be access from redux. So my question is should i use redux-firestore to get, add and update that collection? Or in this case should i use the normal get() add() from the firestore api?

    Thanks

  5. there’s a warning for this..

    const auth = useSelector(state => state.firebase.auth);

    as it says…
    A hook to access the redux store’s state. This hook takes a selector function as an argument. The selector is called with the store state.

    This hook takes an optional equality comparison function as the second parameter that allows you to customize the way the selected state is compared to determine whether the component needs to be re-rendered.

Leave a Reply