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

159
Views
Api data not being displayed due to CORS -axios. ReactJS

I am making an api call to the steam review api with this link: "api link"

I have used another link with my code and was able to get responses and even display the data on my screen, so I have no faulty code. I am currently using this to try and get the result content: comment.reviews.review

This is my complete code:

function Home() {
  const [comments, setComments] = useState([]);
  useEffect(() => {
    fetchComments();
  }, []);
  useEffect(() => {
    console.log(comments);
  }, [comments]);
  const fetchComments = async () => {
    const response = await axios(
      "https://store.steampowered.com/appreviews/1389990?json=1&language=english"
    );
    setComments(response.data);
  };
  var limitComments = comments.slice(0, 3);

  return (
    {limitComments &&
       limitComments.map((comment) => (
          <p>{comment.reviews.review}</p>
                        
     ))}
   );
}

export default Home;

What is wrong with request? I have tried using different keys like comment.author.reviews.review.

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

0

You'll want to brush up on CORS since that's what's preventing your request from succeeding. Here's a great resource:

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

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!