score:1

renderrows is a function so you need to execute it. also you will need to update that function a bit:

export default class app extends component {
  // ...
  componentdidmount(){
    var rows=[];
    var self = this;
    meteor.http.call("get", url ,function(error,result){
      $.each(json.parse(result.content), function(key, value){
        rows.push(value)
      });

      self.setstate({
        rows: rows
      });
    });
  }
  renderrows(){
    const rows = this.state.rows || [];

    return rows.map(d => {
      return(
        <tr>
          <td>{d[0]}</td>
          <td>{d[1]}</td>
          <td>{d[2]}</td>
          <td>{d[3]}</td>
        </tr>
      );
    });
  }
  render(){
    return(
      <table>
        {/* ... */}
        <tbody>
          {this.renderrows()}
        </tbody>
      </table>
    )
  }
}

score:1

another option, not using jquery and avoiding having a separate render function, is to use .map

react likes it if you have a unique key on each element in a list, so hopefully one of the fields on your row can serve this purpose.

  render(){
        return(
          <table>
            <thead>
              <tr>
                <th>col1</th>
                <th>col2</th>
                <th>col3</th>
                <th>col4</th>
              </tr>
            </thead>
            <tbody>
              {this.state.rows.map(d => (
                <tr key={d[0]}>
                  <td>{d[0]}</td>
                  <td>{d[1]}</td>
                  <td>{d[2]}</td>
                  <td>{d[3]}</td>
                </tr>
              )}
            </tbody>
          </table>
        )
      }

you'll also need to set your initial state for rows to be [] rather than null, in order for the first render to work.


Related Query

More Query from same tag