MCPcopy Create free account
hub / github.com/microsoft/SandDance / createFactoryWithValidation

Function createFactoryWithValidation

docs/external/js/react.development.js:2010–2036  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

2008 }
2009 var didWarnAboutDeprecatedCreateFactory = false;
2010 function createFactoryWithValidation(type) {
2011 var validatedFactory = createElementWithValidation.bind(null, type);
2012 validatedFactory.type = type;
2013
2014 {
2015 if (!didWarnAboutDeprecatedCreateFactory) {
2016 didWarnAboutDeprecatedCreateFactory = true;
2017
2018 warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2019 } // Legacy hook: remove it
2020
2021
2022 Object.defineProperty(validatedFactory, 'type', {
2023 enumerable: false,
2024 get: function () {
2025 warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2026
2027 Object.defineProperty(this, 'type', {
2028 value: type
2029 });
2030 return type;
2031 }
2032 });
2033 }
2034
2035 return validatedFactory;
2036 }
2037 function cloneElementWithValidation(element, props, children) {
2038 var newElement = cloneElement.apply(this, arguments);
2039

Callers

nothing calls this directly

Calls 1

warnFunction · 0.70

Tested by

no test coverage detected