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

322
Views
Not getting data from api into the web page, can anyone help me through this where I am getting an error and what can i do to get data

import React from 'react';

/**

  • App

  • Simple react js fetch example */ class App extends React.Component {

    constructor(props) {

     super(props);
    
     this.state = {
         items: [],
         isLoaded: false
     }
    

    }

    /**

    • componentDidMount

    • Fetch json array of objects from given url and update state. */ componentDidMount() {

      fetch('https://run.mocky.io/v3/8260aa5d-8af8-4cff-999e-6e81b217f0ba') .then(res => res.json()) .then(json => { this.setState({ items: json, isLoaded: true, }) }).catch((err) => { console.log(err); });

    }

    /**

    • render

    • Render UI */ render() {

      const { isLoaded, items } = this.state;

      if (!isLoaded) return Loading...;

      return (

        {items.map(item => ( Name: {item.name} ))}
      );

    }

}

export default App;

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

in render function

return (
       {
         items.clients.map(item => (<span key={item.id}> Name : {item.name} 
                </span>)
             )
       }
   )
about 4 years ago · Juan Pablo Isaza Report
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!