I'm using the third party component react-sparklines for a project. However, when I import it to my component as shown below it throws the following error: Uncaught TypeError: Super expression must either be null or a function, not undefined. But when I take it out, the error goes away and the app runs smoothly.
import React, {Component} from 'react';
import {connect} from 'react-redux';
import { Sparklines, SparklinesLine } from 'react-sparklines';
class WeatherList extends React.Component{
renderCity(cityData){
const name = cityData.city.name;
const temps = cityData.list.map(weather => weather.main.temp);
return (
<tr key={name}>
<td>{name}</td>
<td>
<Sparklines data={[5, 10, 5, 20]}>
<SparklinesLine color="blue" />
</Sparklines>
</td>
</tr>
);
}
}
function mapStateToProps(state){
return { weather: state.weather };}
export default connect(mapStateToProps)(WeatherList);
Please note I knowingly left out the render() function. Here's the link to Sparklines: https://github.com/borisyankov/react-sparklines
Any help will be appreciated!