Merge pull request #1334 from spicyj/non-numeric-top-level

Don't break on top-level non-numeric object keys
This commit is contained in:
Cheng Lou 2014-03-30 14:03:18 -07:00
commit 7cbbff01e7
1 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,11 @@ function validateExplicitKey(component) {
* @param {ReactComponent} component Component that requires a key.
*/
function validatePropertyKey(name) {
// We can't provide friendly warnings for top level components.
if (!ReactCurrentOwner.current) {
return;
}
if (NUMERIC_PROPERTY_REGEX.test(name)) {
// Name of the component whose render method tried to pass children.
var currentName = ReactCurrentOwner.current.constructor.displayName;