Wednesday, October 7, 2026
HomeiOS DevelopmentReact Native NOT rendering information from database on IOS

React Native NOT rendering information from database on IOS

[ad_1]

I’ve downside with render information on IOS Simulator. Render is figure correctly on web site, however on IOS i nonetheless received stucked on “Loading..” textual content.

Right here is my code code

import React from 'react'
import { useState } from 'react';
import { useEffect } from 'react';
import { SafeAreaView, Textual content, View, StyleSheet, Picture, Alert } from 'react-native';
import { Card } from 'react-native-paper'
import firebase from 'firebase'
import Button from '../elements/Button'
import Background from '../elements/Background'
import TopBar from '../elements/TopBar'


export default perform HomeScreen({ navigation }) {

  const [data, setData] = useState([])

  const sampleData = [{id:0, title:"One"}, {id:1, title: "Two"}]

  useEffect(() =>
  {
    const donorsData = [];
    firebase.database()
      .ref("testdb")
      .orderByChild("isDonor")
      .equalTo(true)
      .as soon as("worth")
      .then((outcomes) => {
        outcomes.forEach((snapshot) => {
          donorsData.push(snapshot.val());
           });
      });
    setTimeout(() => 
    {

      setData(donorsData);

    }, 1500)

  }, [])

  const card = information.size > 0 
  ? information.map(merchandise =>
  {
    return            <Card key={merchandise.uid} model={{ marginBottom: 20, borderRadius: 10, }}>
    <Textual content>{merchandise.identify}</Textual content>
    <Textual content>{merchandise.description}</Textual content>
    <Picture src={merchandise.picture}></Picture>
  </Card>
  })
  
      : <Textual content>Loading...</Textual content>



  return (
    <View model={types.container}>
      
      {card}
      
    </View>
  );
}

On web site is every part okay Web site Display

However on IOS Simulator i received solely Loading

IOS Display

I attempt lots of options finded right here, however nobody works with this case. I believe is propably becouse iOS dont have information? When i put console log at to high of return, i received nothing.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments