8/16 Images take a long time to render


#1


https://www.codecademy.com/courses/react-101/lessons/react-jsx-advanced/exercises/jsx-event-listeners?action=lesson_resume


I'm currently on step 2 of this exercise. I wrote code to render the 'kitty' picture, but the image took an hour to render. Now that the image is loaded, I'm trying to test my code (the makeDoggy function), but all I'm seeing are the cat picture and loading icons (in the green box at the bottom and at the top right corner). I've been waiting for about 20 minutes now. This seems a bit excessive. I'm living in South Korea and using a South Korean internet connection, so I don't think that's the problem. Is there something wrong with the way I've written my code? Surely this isn't normal.

EDIT: The exercise finally worked as it should a couple minutes after I made this topic, though I did nothing to intervene. Still, is there some mistake I made in my code that caused this exercise to take an hour and a half in loading time?


var React = require('react');
var ReactDOM = require('react-dom');

function makeDoggy (e) {
  // Call this extremely useful function on an <img>.
  // The <img> will become a picture of a doggy.
  e.target.setAttribute('src', 'https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-puppy.jpeg');
  e.target.setAttribute('alt', 'doggy');
}

var kitty = (
	<img 
		src="https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-kitty.jpg" 
		alt="kitty" 
    onClick={makeDoggy} />
);

ReactDOM.render(kitty, document.getElementById('app'));


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.