LAKSHMAN GOPE
LAKSHMAN GOPE

Reputation: 1

Warning: validateDOMNesting(...): <tr> cannot appear as a child of <form>

When rendering this form, I receive the error

<tr> cannot appear as a child of <form>.

in the browser console. How do I get rid of this?

<form id='works_input_form' onSubmit={handleSubmit}>
      <tr className='text-center'>
        <td>
          <div className='form-group'>
            <textarea
              className='form-control'
              id='title'
              rows='1'
              cols='26'
              placeholder='Name'
              required
              onChange={handleTaskChange}
            ></textarea>
          </div>
        </td>
    
        <td>
          <div className='form-group p-2'>
            <textarea
              className='form-control'
              id='title'
              rows='1'
              cols='26'
              placeholder='Subject'
              required
              onChange={handleSubjectChange}
            ></textarea>
          </div>
        </td>
      </tr>
    </form>

Upvotes: 0

Views: 1627

Answers (1)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

Yes. tr tag cannot reside directly other than table and/or tbody, thead, tfoot:

<table>
  <tr>

Or,

<table>
  <tbody> <!-- thead, or tfoot -->
   <tr>

Learn here about the table html markup.

Upvotes: 1

Related Questions