Socket
Socket
Sign inDemoInstall

react

Package Overview
Dependencies
Maintainers
7
Versions
1975
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react - npm Package Compare versions

Comparing version 15.2.0-rc.1 to 15.2.0-rc.2

38

lib/ReactDOMUnknownPropertyDevtool.js

@@ -27,2 +27,3 @@ /**

autoFocus: true,
defaultValue: true,

@@ -39,11 +40,11 @@ valueLink: true,

var warnUnknownProperty = function (tagName, name, debugID) {
var validateProperty = function (tagName, name, debugID) {
if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
return;
return true;
}
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return;
return true;
}
if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
return;
return true;
}

@@ -60,4 +61,6 @@ warnedProperties[name] = true;

process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
return true;
} else if (registrationName != null) {
process.env.NODE_ENV !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
return true;
} else {

@@ -67,3 +70,4 @@ // We were unable to guess which prop the user intended.

// Components should be careful to only render valid props/attributes.
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop `%s` on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', name, tagName, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
// Warning will be invoked in warnUnknownProperties to allow grouping.
return false;
}

@@ -73,2 +77,22 @@ };

var warnUnknownProperties = function (debugID, element) {
var unknownProps = [];
for (var key in element.props) {
var isValid = validateProperty(element.type, key, debugID);
if (!isValid) {
unknownProps.push(key);
}
}
var unknownPropString = unknownProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (unknownProps.length === 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
} else if (unknownProps.length > 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
}
};
function handleElement(debugID, element) {

@@ -81,5 +105,3 @@ if (element == null || typeof element.type !== 'string') {

}
for (var key in element.props) {
warnUnknownProperty(element.type, key, debugID);
}
warnUnknownProperties(debugID, element);
}

@@ -86,0 +108,0 @@

@@ -14,2 +14,2 @@ /**

module.exports = '15.2.0-rc.1';
module.exports = '15.2.0-rc.2';
{
"name": "react",
"description": "React is a JavaScript library for building user interfaces.",
"version": "15.2.0-rc.1",
"version": "15.2.0-rc.2",
"keywords": [

@@ -6,0 +6,0 @@ "react"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc