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

120
Views
data from object not rendering in any component in react native

i created a use effect hook to fetch data from an api and set it to a variable like this:

 const [rich, setData] = useState([]);
  useEffect(() => {
    fetch('http://api.mediastack.com/v1/news?access_key=API_KEY&languages=en&countries=us,gb,ng,-ma,-ar,-qa,-sd')
      .then((response) => response.json())
      .then((json) => setData(json))
      .catch((error) => console.error(error))
      .finally(() => setLoading(false));
  }, []);

after that i tried to render the data out on the screen like this:

<View> {
          rich.data.forEach(item => {
            console.log(item.author);
            <Text>{`data: ${item.author}`}</Text>
            
          })

          }
     </View>

now the issue is that the console.log works but if i put it in the text component like i did, it wouldn't display.

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!