Im having a problem with my react app, where im unable to show the same icon from skycons twice.
I found this post with the same issue. However - when I copy the solution I get an error bundle.js:130 Uncaught ReferenceError: e is not defined
For reference this is my code
componentDidMount() {
this.serverRequest = $.get(this.props.source, function (result) {
this.setState({
forecast: result.currently,
daily: result.daily.data
});
var icons = new Skycons({
"color": "#666"
}),
list = [
"clear-day", "clear-night", "partly-cloudy-day",
"partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
"fog"
],
i;
for (i = list.length; i--;) {
var weatherType = list[i],
elements = document.getElementsByClassName(weatherType);
for (e = elements.length; e--;) {
icons.set(elements[e], weatherType);
}
}
icons.play();
}.bind(this));
}
I've tried to declare e
different places in the code, but it didn't work for me, even though the code is copy/pasted
And obviously the error is somewhere here for (e = elements.length; e--;) {