@samitouri / QOS-React-2 / commits / e8ef06783a

Update warning calls to use %s #2870

Kevin Old committed Jan 25, 2015 at 23:38 UTC e8ef06783ad85491bd833c6bfc54c6395250f6db
5 files changed +24 -12
src/browser/ui/dom/CSSPropertyOperations.js
+6 -4
@@ -51,8 +51,9 @@ if (__DEV__) {
51 warnedStyleNames[name] = true;
52 warning(
53 false,
54 - 'Unsupported style property ' + name + '. Did you mean ' +
55 - camelizeStyleName(name) + '?'
54 + 'Unsupported style property %s. Did you mean %s?',
55 + name,
56 + camelizeStyleName(name)
57 );
58 };
59
@@ -64,8 +65,9 @@ if (__DEV__) {
65 warnedStyleNames[name] = true;
66 warning(
67 false,
67 - 'Unsupported vendor-prefixed style property ' + name + '. Did you mean ' +
68 - name.charAt(0).toUpperCase() + name.slice(1) + '?'
68 + 'Unsupported vendor-prefixed style property %s. Did you mean %s?',
69 + name,
70 + name.charAt(0).toUpperCase() + name.slice(1)
71 );
72 };
73
src/browser/ui/dom/DOMPropertyOperations.js
+3 -1
@@ -61,7 +61,9 @@ if (__DEV__) {
61 // logging too much when using transferPropsTo.
62 warning(
63 standardName == null,
64 - 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
64 + 'Unknown DOM property %s. Did you mean %s?',
65 + name,
66 + standardName
67 );
68
69 };
src/classic/element/ReactElement.js
+3 -2
@@ -45,8 +45,9 @@ function defineWarningProperty(object, key) {
45 set: function(value) {
46 warning(
47 false,
48 - 'Don\'t set the ' + key + ' property of the React element. Instead, ' +
49 - 'specify the correct value when initially creating the element.'
48 + 'Don\'t set the %s property of the React element. Instead, ' +
49 + 'specify the correct value when initially creating the element.',
50 + key
51 );
52 this._store[key] = value;
53 }
src/classic/element/ReactElementValidator.js
+6 -3
@@ -306,9 +306,12 @@ function warnForPropsMutation(propName, element) {
306
307 warning(
308 false,
309 - 'Don\'t set .props.' + propName + ' of the React component' +
310 - elementInfo + '. Instead, specify the correct value when ' +
311 - 'initially creating the element.' + ownerInfo
309 + 'Don\'t set .props.%s of the React component%s. ' +
310 + 'Instead, specify the correct value when ' +
311 + 'initially creating the element.%s',
312 + propName,
313 + elementInfo,
314 + ownerInfo
315 );
316 }
317
src/utils/deprecated.js
+6 -2
@@ -31,8 +31,12 @@ function deprecated(namespace, oldName, newName, ctx, fn) {
31 var newFn = function() {
32 warning(
33 warned,
34 - `${namespace}.${oldName} will be deprecated in a future version. ` +
35 - `Use ${namespace}.${newName} instead.`
34 + '%s.%s will be deprecated in a future version. ' +
35 + 'Use %s.%s instead.',
36 + namespace,
37 + oldName,
38 + namespace,
39 + newName
40 );
41 warned = true;
42 return fn.apply(ctx, arguments);