@@ -83,13 +83,17 @@ if (__DEV__) {
83
83
84
84
var issuedWarnings = { } ;
85
85
86
- var didWarnForFragment = function ( fragment ) {
87
- // We use the keys and the type of the value as a heuristic to dedupe the
88
- // warning to avoid spamming too much.
86
+ var getFragmentKeyString = function ( fragment ) {
89
87
var fragmentCacheKey = '' ;
90
88
for ( var key in fragment ) {
91
89
fragmentCacheKey += key + ':' + ( typeof fragment [ key ] ) + ',' ;
92
90
}
91
+ return fragmentCacheKey ;
92
+ } ;
93
+
94
+ var didWarnForFragment = function ( fragmentCacheKey ) {
95
+ // We use the keys and the type of the value as a heuristic to dedupe the
96
+ // warning to avoid spamming too much.
93
97
var alreadyWarnedOnce = ! ! issuedWarnings [ fragmentCacheKey ] ;
94
98
issuedWarnings [ fragmentCacheKey ] = true ;
95
99
return alreadyWarnedOnce ;
@@ -143,11 +147,13 @@ var ReactFragment = {
143
147
if ( __DEV__ ) {
144
148
if ( canWarnForReactFragment ) {
145
149
if ( ! fragment [ fragmentKey ] ) {
150
+ var fragmentKeys = getFragmentKeyString ( fragment ) ;
146
151
warning (
147
- didWarnForFragment ( fragment ) ,
152
+ didWarnForFragment ( fragmentKeys ) ,
148
153
'Any use of a keyed object should be wrapped in ' +
149
154
'React.addons.createFragment(object) before being passed as a ' +
150
- 'child.'
155
+ 'child. {%s}' ,
156
+ fragmentKeys
151
157
) ;
152
158
return fragment ;
153
159
}
0 commit comments