Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
Property 'db' does not exist on type '() => Promise'.ts

I have this code to get the data from the database.But I got this error "Property 'db' does not exist on type '() => Promise'.ts" on firebase.db How should I rewrite it?

import './services/firebase';
import * as Font from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import React, { useState, useEffect, useCallback } from 'react';
import AntDesign from '@expo/vector-icons/AntDesign';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import Moment from 'react-moment';
import 'moment/locale/uk';
import DateSlider from './components/date_slider';
import LessonList from './components/lesson_list'
import Lessons_local from './components/data.json';
import theme from './assets/themes';
import { firebase } from './services/firebasedb';


export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
const [index, setIndex] = useState(0);
const [lessons, setLessons] = useState();

useEffect(() => {
 async function prepare() {
  try {
    await SplashScreen.preventAutoHideAsync();
    await Font.loadAsync(AntDesign.font);
    let data = await firebase.db.ref('UpcomingGames').once('value', snapshot => {
      data = snapshot.val()
      console.log('upcoming t2',data)
      return data
  })
    setLessons(data);
  } catch (e) {
    console.warn(e);
  } finally {
    setAppIsReady(true);
  }
} 

prepare();
}, []);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!