When I comment out any JSX HTML (using key combination Ctrl+/) in VS Code, it inserts {/* around the line */}. In most places this is fine, but it causes this error when a comment is a direct child of a div or table:
Type 'undefined' is not assignable to type 'Child'.
Example:
<div>
<p>Any other tag</p>
{/* This comment causes an error */}
</div>
<table>
<thead>
{/* This comment is okay */}
</thead>
<tbody>
{/* This comment is fine */}
</tbody>
{/* This comment causes an error */}
</table>
Apparently {/* ... */} has a type of undefined (makes sense), but JSX div and table elements are not set up to take undefined values. The 'Child' type should probably include undefined to account for this situation. I only see this occur with div and table elements, and haven't come across any other instances of this happening.
When I comment out any JSX HTML (using key combination Ctrl+/) in VS Code, it inserts
{/*
around the line*/}
. In most places this is fine, but it causes this error when a comment is a direct child of a div or table:Example:
Apparently
{/* ... */}
has a type of undefined (makes sense), but JSX div and table elements are not set up to take undefined values. The 'Child' type should probably includeundefined
to account for this situation. I only see this occur with div and table elements, and haven't come across any other instances of this happening.