src/classic/element/ReactElementValidator.js
/**
 * Warn about mutating props when setting `propName` on `element`.
 *
 * @param {string} propName The string key within props that was set
 * @param {ReactElement} element
 */
Warn about mutating props when setting `propName` on `element`.
@param {string} propName The string key within props that was set
@param {ReactElement} element
Warn about mutating props when setting ` propName ` on ` element ` . @param { string } propName The string key within props that was set @param { ReactElement } element
function warnForPropsMutation(propName, element) {
  var type = element.type;
  var elementName = typeof type === 'string' ? type : type.displayName;
  var ownerName = element._owner ?
    element._owner.getPublicInstance().constructor.displayName : null;
  var warningKey = propName + '|' + elementName + '|' + ownerName;
  if (warnedPropsMutations.hasOwnProperty(warningKey)) {
    return;
  }
  warnedPropsMutations[warningKey] = true;
  var elementInfo = '';
  if (elementName) {
    elementInfo = ' <' + elementName + ' />';
  }
  var ownerInfo = '';
  if (ownerName) {
    ownerInfo = ' The element was created by ' + ownerName + '.';
  }
  warning(
    false,
    'Don\'t set .props.%s of the React component%s. ' +
    'Instead, specify the correct value when ' +
    'initially creating the element.%s',
    propName,
    elementInfo,
    ownerInfo
  );
}
function warnForPropsMutation ( propName , element ) { var type = element . type ; var elementName = typeof type === 'string' ? type : type . displayName ; var ownerName = element . _owner ? element . _owner . getPublicInstance ( ) . constructor . displayName : null ; var warningKey = propName + '|' + elementName + '|' + ownerName ; if ( warnedPropsMutations . hasOwnProperty ( warningKey ) ) { return ; } warnedPropsMutations [ warningKey ] = true ; var elementInfo = '' ; if ( elementName ) { elementInfo = ' <' + elementName + ' />' ; } var ownerInfo = '' ; if ( ownerName ) { ownerInfo = ' The element was created by ' + ownerName + '.' ; } warning ( false , 'Don\'t set .props.%s of the React component%s. ' + 'Instead, specify the correct value when ' + 'initially creating the element.%s' , propName , elementInfo , ownerInfo ) ; }
Warn about mutating props when setting `propName` on `element`.
Warn about mutating props when setting ` propName ` on ` element ` .