kev kev - 11 months ago 126
React JSX Question

react-text comments causes invisible line

React Comments like:

`<!-- react-text: 3 -->
<!-- /react-text -->`

get rendered as empty line messing up with the design. Is there any way to prevent this from happening?

Edit: there is
between the opening and closing tags. It's not visible in the code above but in the fiddle. I copy pasted both from vim (see screenshot).

enter image description here

Answer Source

React has added that block because an empty element was rendered. To remove it you will have to see where that empty element is generated. It is likely it is from an empty string - they can cause these seemingly unnecessary react comment blocks.