lib/attributes-to-props.js
function attributesToProps(attributes) {
  attributes = attributes || {};
  var props = {};
  var propertyName;
  var propertyValue;
  var reactProperty;

  for (propertyName in attributes) {
    propertyValue = attributes[propertyName];

    // custom attributes (`data-` and `aria-`)
    if (isCustomAttribute(propertyName)) {
      props[propertyName] = propertyValue;
      continue;
    }

    // make HTML DOM attribute/property consistent with React attribute/property
    reactProperty = config.html[propertyName.toLowerCase()];
    if (reactProperty) {
      if (
        DOMProperty.properties.hasOwnProperty(reactProperty) &&
        DOMProperty.properties[reactProperty].hasBooleanValue
      ) {
        props[reactProperty] = true;
      } else {
        props[reactProperty] = propertyValue;
      }
      continue;
    }

    // make SVG DOM attribute/property consistent with React attribute/property
    reactProperty = config.svg[propertyName];
    if (reactProperty) {
      props[reactProperty] = propertyValue;
    } else if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
      props[propertyName] = propertyValue;
    }
  }

  // convert inline style to object
  if (attributes.style != null) {
    props.style = cssToJs(attributes.style);
  }
  return props;
}
function attributesToProps(attributes) {
  attributes = attributes || {};
  var props = {};
  var propertyName;
  var propertyValue;
  var reactProperty;

  for (propertyName in attributes) {
    propertyValue = attributes[propertyName];

    // custom attributes (`data-` and `aria-`)
    if (isCustomAttribute(propertyName)) {
      props[propertyName] = propertyValue;
      continue;
    }

    // make HTML DOM attribute/property consistent with React attribute/property
    reactProperty = config.html[propertyName.toLowerCase()];
    if (reactProperty) {
      if (
        DOMProperty.properties.hasOwnProperty(reactProperty) &&
        DOMProperty.properties[reactProperty].hasBooleanValue
      ) {
        props[reactProperty] = true;
      } else {
        props[reactProperty] = propertyValue;
      }
      continue;
    }

    // make SVG DOM attribute/property consistent with React attribute/property
    reactProperty = config.svg[propertyName];
    if (reactProperty) {
      props[reactProperty] = propertyValue;
    } else if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
      props[propertyName] = propertyValue;
    }
  }

  // convert inline style to object
  if (attributes.style != null) {
    props.style = cssToJs(attributes.style);
  }
  return props;
}
function attributesToProps ( attributes ) { attributes = attributes || { } ; var props = { } ; var propertyName ; var propertyValue ; var reactProperty ; for ( propertyName in attributes ) { propertyValue = attributes [ propertyName ] ; // custom attributes (`data-` and `aria-`) if ( isCustomAttribute ( propertyName ) ) { props [ propertyName ] = propertyValue ; continue ; } // make HTML DOM attribute/property consistent with React attribute/property reactProperty = config . html [ propertyName . toLowerCase ( ) ] ; if ( reactProperty ) { if ( DOMProperty . properties . hasOwnProperty ( reactProperty ) && DOMProperty . properties [ reactProperty ] . hasBooleanValue ) { props [ reactProperty ] = true ; } else { props [ reactProperty ] = propertyValue ; } continue ; } // make SVG DOM attribute/property consistent with React attribute/property reactProperty = config . svg [ propertyName ] ; if ( reactProperty ) { props [ reactProperty ] = propertyValue ; } else if ( utilities . PRESERVE_CUSTOM_ATTRIBUTES ) { props [ propertyName ] = propertyValue ; } } // convert inline style to object if ( attributes . style != null ) { props . style = cssToJs ( attributes . style ) ; } return props ; }
Makes attributes compatible with React props.

@param  {Object} [attributes={}] - The attributes.
@return {Object}                 - The props.
Makes attributes compatible with React props .