Generation of a  in React without  wrapping elements In React, the render method must have one and exactly one child (although that child may have many more children). As a result, it becomes difficult to render elements that intrinsically need multiple elements as children without wrapping them in an unsemantic - and in the case of &lt;dl&gt;, forbidden - &lt;div&gt; element.

As I result, I wrote the following code to help generate a definition list from a model. I'd like to know what you guys think. Its being used in my company's application at the moment and I was wondering if there was anything I could improve on.

'use strict'
import React from 'react'
import createFragment from 'react-addons-create-fragment'
import isArray from 'lodash.isarray'

/**
 * Creates a &lt;dl&gt; element using React from the given map.
 * @param  {Map&lt;string, any|Array&lt;any&gt;&gt;} map A map of name-value pairs. The keys of the map are used as labels for definitions, so they should be legible. The values are used as the value of the definition. If there are multiple values to a definition (i.e, an array), then multiple &lt;dd&gt; elements will be created for the resultant &lt;dt&gt;.
 * @return {ReactElement} A React element encapsulating the &lt;dl&gt;.
 */
export default function createDefinitionList(map) {
  const labels = Object.keys(map)

  return &lt;dl&gt;
    {labels.map((label) =&gt; createDefinitionFragment(label, map[label]))}
  &lt;/dl&gt;
}

/**
 * Creates a &lt;dt&gt; with associated &lt;dd&gt;s inside of a React fragment. Fragments are keyed.
 * @param  {string} label A human-readable description of the definition
 * @param  {any|Array&lt;any&gt;} value a value, or a set of values. If given a set of values, multiple &lt;dd&gt; elements will be generated; these elements will be keyed using their array index.
 * @return {ReactElement} A definition list in React element form.
 */
function createDefinitionFragment(label, value) {
  return createFragment({
    definition: &lt;dt&gt;{label}&lt;/dt&gt;,
    value: createDefinitionValueFragments(value)
  })
}


/**
 * Creates a React &lt;dd&gt; fragment for the given value. If value is an array, a fragment will be created which encapsulates all values.
 * @param  {any|Array&lt;any&gt;} value A singular value will return a react fragment containing just the one value encapsulated in a &lt;dd&gt;. Otherwise, a Fragment will be returned that contains many &lt;dd&gt;.
 * @return {ReactElement} A React fragment contain the definition values
 */
function createDefinitionValueFragments(value) {
  if (isArray(value)) {
    return value.map(function (val) {
      return &lt;dd&gt;{val}&lt;/dd&gt;
    })
  }

  return &lt;dd&gt;{value}&lt;/dd&gt;
}


Here is an example of the usage. This is basically how we use it now, except this model is retrieved via Ajax, and that's a lot of code for me to paste in a CR question. So, for sake of example, here's a finished call from one of those AJAX calls.

// Example of usage
const keyPerformanceIndicators = {
  'Calls': 0,
  'Tickets': 1,
  'Demos': [0, 10]
}

const definitionList = createDefinitionList(keyPerformanceIndicators)
React.render(definitionList, document.body)


The expected output ends up looking like this (data-reactid omitted for brevity)

&lt;dl&gt;
  &lt;dt&gt;Calls&lt;/dt&gt;
  &lt;dd&gt;0&lt;/dd&gt;
  &lt;dt&gt;Tickets&lt;/dt&gt;
  &lt;dd&gt;1&lt;/dd&gt;
  &lt;dt&gt;Demos&lt;/dt&gt;
  &lt;dd&gt;0&lt;/dd&gt;
  &lt;dd&gt;10&lt;/dd&gt;
&lt;/dl&gt;


I intend to release this as a general-purpose library as this is a niche I don't think has yet been filled in React (surprisingly). I'd like any suggestions on improving it before doing so.
as of React 16 version you can use 

&lt;React.Fragment&gt;
    &lt;dt&gt;Term&lt;/dt&gt;
    &lt;dd&gt;Definition&lt;/dd&gt;
&lt;/React.Fragment&gt;


React.Fragment will not render any DOM, but it'll act as a container.
You can also use a short hand for React.Fragment as &lt;&gt;

&lt;&gt;
    &lt;dt&gt;Term&lt;/dt&gt;
    &lt;dd&gt;Definition&lt;/dd&gt;
&lt;/&gt;


It works in the same way, except that it doesn't support any attributes or key.

https://reactjs.org/docs/fragments.html