Search⌘ K
AI Features

Exercise 11: Real-time Database!

Explore the integration of Firebase Real-time Database into your React app. This lesson guides you through activating the database on Firebase, setting up references, and managing user data effectively in real time. Understand key steps to implement and use real-time data to enhance your application's interactivity.

We'll cover the following...

Project

import React from 'react';

import { AuthUserContext } from '../Session';
import { PasswordForgetForm } from '../PasswordForget';
import PasswordChangeForm from '../PasswordChange';
import { withAuthorization } from '../Session';

const AccountPage = () => (
  <AuthUserContext.Consumer>
    {authUser => (
      <div>
        <h1>Account: {authUser.email}</h1>
        <PasswordForgetForm />
        <PasswordChangeForm />
      </div>
    )}
  </AuthUserContext.Consumer>
);

const authCondition = authUser => !!authUser;

export default withAuthorization(authCondition)(AccountPage);

We’ve implemented the Real-time Database interface in src/components/Firebase/firebase.js as we did for the authentication ...