diff --git a/packages/react/src/ReactElement.js b/packages/react/src/ReactElement.js index a2914b78fc..a988bfb800 100644 --- a/packages/react/src/ReactElement.js +++ b/packages/react/src/ReactElement.js @@ -266,7 +266,7 @@ export function createFactory(type) { // easily accessed on elements. E.g. `.type === Foo`. // This should not be named `constructor` since this may not be the function // that created the element, and it may not even be a constructor. - // Legacy hook TODO: Warn if this is accessed + // Legacy hook: remove it factory.type = type; return factory; } diff --git a/packages/react/src/ReactElementValidator.js b/packages/react/src/ReactElementValidator.js index 3b547b9aff..bdf67881a7 100644 --- a/packages/react/src/ReactElementValidator.js +++ b/packages/react/src/ReactElementValidator.js @@ -357,9 +357,8 @@ export function createElementWithValidation(type, props, children) { export function createFactoryWithValidation(type) { const validatedFactory = createElementWithValidation.bind(null, type); - // Legacy hook TODO: Warn if this is accessed validatedFactory.type = type; - + // Legacy hook: remove it if (__DEV__) { Object.defineProperty(validatedFactory, 'type', { enumerable: false,