React Fragment

const Fragment = React.Fragment;

render() {
  return (
    <Fragment>
      Some text.
      <h2>A heading</h2>
      Even more text.
    </Fragment>
  );
}
render() {
  return (
    <React.Fragment>
      Some text.
      <h2>A heading</h2>
      Even more text.
    <React.Fragment>
  );
}
render() {
  return (
    <>
      <ComponentA />
      <ComponentB />
    </>
  );
}

Leave a Reply

Your email address will not be published. Required fields are marked *