I am new to react.js and I am trying to fetch server side data in JSON format in a table. So what I did is:
export default class TableUser extends React.Component {
constructor(props) {
super(props);
this.state = {
table: [],
}
}
componentDidMount(){
axios.get('http://www.reddit.com/r/reactjs.json')
.then((response)=>{
const table = response.data.map(obj => obj.data);
this.setState({ table });
})
.catch((err)=>{
})
}
And I am rendering this in a <div> like:
render(){
<div><p>{this.state.table.kind}</p></div>
}
why I am not getting the value for kind?
Please suggest!!