meteor - validateDOMNesting(...): #text cannot appear as a child of <tr> -


i creating reusable component table , facing warning in console is:-

validatedomnesting(...): #text cannot appear child of <tr>.  

here sample code :-

this render method in checking value of object if json make linkable row otherwise simple text.

return (    <div classname="table-responsive" id={self.props.tableid}>        <table id="table3"classname="table table-bordered">            <tbody>               {                  this.isjson(self.props.columns.labels[0]) ?                      (this.props.records.map((record, index) => {                          return self.makelink( record, index)                      })) : (this.props.records.map((record, index) => {                          return ( <tr key = { index } > {                              self.props.columns.labels.map((label, index) => {                                  return ( <td key = { index } > { self.rendertabledata(index, record) } </td>)                              })                          } </tr> )                      }))              }             </tbody>        </table>    </div>                              ); 

makelink function :-

  makelink(record, index){     var self = this;     return (        <tr key={index} onclick={this.redirect.bind(this,record._id)} >        {this.props.columns.labels.map((label, index) =>{            return (               <td key={index}>{self.rendertabledata(index,record)}</td>             )        })}    </tr>   ) } 

thanks in advance

just error says, can't have text directly inside <tr>, have put inside <th> or <td>.

<table>   <tbody>     <tr>       <td>...</td>     </tr>   </tbody> </table> 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -