Currently the render method can only return a single element/component. See: here
In the discussion under that ticket some suggest to wrap multiple elements returned
Assuming you are on React 16.8+ you may use a small functional component which lets you provide a text property and render an html comment.
import React, {useEffect, useRef} from 'react';
const ReactComment = ( props ) => {
const el = useRef();
useEffect( () => {
el.current.outerHTML = ``;
}, [] );
return (