lib/jsx.js
function transformElement({ name: type, attribs: props, children: childElements }) {
  transformStyle(props);
  rename(props, 'for', 'htmlFor');
  rename(props, 'class', 'className');
  if ('input' === type) {
    rename(props, 'checked', 'defaultChecked');
    rename(props, 'value', 'defaultValue');
  }
  let children = transformElements(childElements);

  if ('textarea' === type && children.length) {
    props.defaultValue = children[0];
    children = [];
  }

  return { type, props, children };
}
function transformElement({ name: type, attribs: props, children: childElements }) {
  transformStyle(props);
  rename(props, 'for', 'htmlFor');
  rename(props, 'class', 'className');
  if ('input' === type) {
    rename(props, 'checked', 'defaultChecked');
    rename(props, 'value', 'defaultValue');
  }
  let children = transformElements(childElements);

  if ('textarea' === type && children.length) {
    props.defaultValue = children[0];
    children = [];
  }

  return { type, props, children };
}
function transformElement ( { name : type , attribs : props , children : childElements } ) { transformStyle ( props ) ; rename ( props , 'for' , 'htmlFor' ) ; rename ( props , 'class' , 'className' ) ; if ( 'input' === type ) { rename ( props , 'checked' , 'defaultChecked' ) ; rename ( props , 'value' , 'defaultValue' ) ; } let children = transformElements ( childElements ) ; if ( 'textarea' === type && children . length ) { props . defaultValue = children [ 0 ] ; children = [ ] ; } return { type , props , children } ; }
Converts a Cheerio Element into an object that can later be used to create a React Element.

@memberof module:jsx
@private
@method transformElement
@param {Object} element - a Cheerio Element
@return {Object} a plain object describing a React Element
Converts a Cheerio Element into an object that can later be used to create a React Element .