MCPcopy Create free account
hub / github.com/Lucifier129/react-lite / deprecated

Function deprecated

examples/simple/react.js:15928–15946  ·  view source on GitHub ↗

* This will log a single deprecation notice per function and forward the call * on to the new API. * * @param {string} fnName The name of the function * @param {string} newModule The module that fn will exist in * @param {string} newPackage The module that fn will exist in * @param {*} ctx The

(fnName, newModule, newPackage, ctx, fn)

Source from the content-addressed store, hash-verified

15926 * @return {function} The function that will warn once and then call fn
15927 */
15928function deprecated(fnName, newModule, newPackage, ctx, fn) {
15929 var warned = false;
15930 if ("development" !== 'production') {
15931 var newFn = function () {
15932 "development" !== 'production' ? warning(warned,
15933 // Require examples in this string must be split to prevent React's
15934 // build tools from mistaking them for real requires.
15935 // Otherwise the build tools will attempt to build a '%s' module.
15936 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
15937 warned = true;
15938 return fn.apply(ctx, arguments);
15939 };
15940 // We need to make sure all properties of the original fn are copied over.
15941 // In particular, this is needed to support PropTypes
15942 return assign(newFn, fn);
15943 }
15944
15945 return fn;
15946}
15947
15948module.exports = deprecated;
15949},{"154":154,"23":23}],106:[function(_dereq_,module,exports){

Callers 1

react.jsFile · 0.85

Calls 1

assignFunction · 0.85

Tested by

no test coverage detected