React.Fragment

React.Fragment components lets you return multiple elements in render so that you don't have to wrap unnecessary DOM .

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

or

render() {
  return (
    <>
      Some text.
      <h2>A heading</h2>
    </>
  );
}

results matching ""

    No results matching ""