I’ve been working on the Bar Chart Project in the Data Viz exercises. The component where I call the data is below, but I don’t get any response at all. Am I doing something wrong?
class DataStuff extends React.Component {
constructor(props) {
super(props);
this.state = {
gdpData: [],
};
}
componentDidMount() {
d3.json("https://raw.githubusercontent.com/FreeCodeCamp/ProjectReferenceData/master/GDP-data.json", function (data) {
var dataSet = data.data;
console.log(dataSet);
});
}
render() {
return (<p>Data: {}</p>)
};
}
ReactDOM.render(<DataStuff />, document.getElementById('root'));