DEV Community

Discussion on: Need some help & advice from React.js devs!

Collapse
 
mathewthe2 profile image
Mathew Chan • Edited

this.setState({data}) is shorthand for this.setState({data: data}), i.e. you assign the value of data to this.state.data. To render the data to your table

render() {
  const {data} = this.state;
  return (
    <table>
    <tr>
      <th>Date</th>
      <th>Company<th/>
    </tr>
    data.map(item=>return(
      <tr>
        <td>{item.Date}</td>
        <td>{item.Company_nm}</td>
      </tr>
    ))
    </table>
  )
}
Enter fullscreen mode Exit fullscreen mode