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

399
Views
Problemas al analizar datos: no capturado (en promesa) SyntaxError: JSON.parse: carácter inesperado en la línea 1, columna 1 de los datos JSON

Tengo un pequeño problema para entender este error: Uncaught (en promesa) SyntaxError: JSON.parse: carácter inesperado en la línea 1 columna 1 de los datos JSON

Intenté analizar los datos para ver si se mostraba algo, pero aún se muestra en blanco. Cualquier ayuda sería apreciada.

 import React, { useState} from 'react'; function Drinks () { //if nothing is entered it defaults to Blue Margarita const[drinks, setDrinks] = useState("Blue Margarita"); function handleChange(e){ setDrinks(e.target.value); } // 'margarita' function getDrinks(){ // www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita fetch(`www.thecocktaildb.com/api/json/v1/1/search.php?s=${drinks}`) .then((res)=> res.json()) .then((data)=>{ setDrinks(data) console.log(data); }) // .catch(()=> { // console.log("err") // }); }; return ( <article> <div> <input type="String"placeholder="Enter a drink" onChange={handleChange}/> <button className="btn"onClick={getDrinks}>getDrink</button> </div> <h1>{getDrinks.strDrink}</h1> <h2>{getDrinks.idDrink}</h2> </article> ) } export default Drinks
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!