ExerciseDB

פרמיום
על ידי Justin | מְעוּדכָּן 9 days ago | Health and Fitness
פּוֹפּוּלָרִיוּת

9.9 / 10

חֶבִיוֹן

375ms

רמת שירות

95%

Health Check

100%

חזרה לכל הדיונים

How can I fix the error with gifurl output to display a gif when I click on it? I get a ERROR Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at fetchData and undefined error when I click on an exercise.

Rapid account: Deleted
[deleted]
6 months ago

useEffect(() => {
const fetchExerciseData = async () => {
const exerciseDbUrl = ‘https://exercisedb.p.rapidapi.com’;
const youtubeSearchUrl = ‘https://youtube-search-and-download.p.rapidapi.com’;
const exerciseDetailData = await fetchData(${exerciseDbUrl}/exercises/exercise/${id}, exerciseOptions);
console.log({exerciseDetailData});
setExerciseDetail(exerciseDetailData);
}

<Stack gap=“60px” sx={{ flexDirection: { lg: ‘row’ }, p: ‘20px’, alignItems: ‘center’ }}>
<img src={gifUrl} alt={name} Loading=“lazy” className=‘detail-image’ />

</Stack>

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות