diff --git a/packages/events/EventPluginRegistry.js b/packages/events/EventPluginRegistry.js index ccfaa872dc..efebd984e8 100644 --- a/packages/events/EventPluginRegistry.js +++ b/packages/events/EventPluginRegistry.js @@ -15,13 +15,10 @@ import type { } from './PluginModuleType'; import invariant from 'fbjs/lib/invariant'; -import lowPriorityWarning from 'shared/lowPriorityWarning'; type NamesToPlugins = {[key: PluginName]: PluginModule}; type EventPluginOrder = null | Array; -let shouldWarnOnInjection = false; - /** * Injectable ordering of event plugins. */ @@ -32,10 +29,6 @@ let eventPluginOrder: EventPluginOrder = null; */ const namesToPlugins: NamesToPlugins = {}; -export function enableWarningOnInjection() { - shouldWarnOnInjection = true; -} - /** * Recomputes the plugin list using the injected plugins and plugin ordering. * @@ -228,21 +221,6 @@ export function injectEventPluginOrder( export function injectEventPluginsByName( injectedNamesToPlugins: NamesToPlugins, ): void { - if (__DEV__) { - if (shouldWarnOnInjection) { - const names = Object.keys(injectedNamesToPlugins).join(', '); - lowPriorityWarning( - false, - 'Injecting custom event plugins (%s) is deprecated ' + - 'and will not work in React 17+. Please update your code ' + - 'to not depend on React internals. The stack trace for this ' + - 'warning should reveal the library that is using them. ' + - 'See https://github.com/facebook/react/issues/11689 for a discussion.', - names, - ); - } - } - let isOrderingDirty = false; for (const pluginName in injectedNamesToPlugins) { if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { diff --git a/packages/react-dom/src/__tests__/ReactDOM-test.js b/packages/react-dom/src/__tests__/ReactDOM-test.js index dd7f97484b..15d3d9b4dc 100644 --- a/packages/react-dom/src/__tests__/ReactDOM-test.js +++ b/packages/react-dom/src/__tests__/ReactDOM-test.js @@ -377,25 +377,6 @@ describe('ReactDOM', () => { } }); - // https://github.com/facebook/react/issues/11689 - it('should warn when attempting to inject an event plugin', () => { - expect(() => { - ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.EventPluginHub.injection.injectEventPluginsByName( - { - TapEventPlugin: { - extractEvents() {}, - }, - }, - ); - }).toLowPriorityWarnDev( - 'Injecting custom event plugins (TapEventPlugin) is deprecated ' + - 'and will not work in React 17+. Please update your code ' + - 'to not depend on React internals. The stack trace for this ' + - 'warning should reveal the library that is using them. ' + - 'See https://github.com/facebook/react/issues/11689 for a discussion.', - ); - }); - it('throws in DEV if jsdom is destroyed by the time setState() is called', () => { class App extends React.Component { state = {x: 1}; diff --git a/packages/react-dom/src/__tests__/TapEventPlugin-test.internal.js b/packages/react-dom/src/__tests__/TapEventPlugin-test.internal.js index bd5b097915..b822da91b0 100644 --- a/packages/react-dom/src/__tests__/TapEventPlugin-test.internal.js +++ b/packages/react-dom/src/__tests__/TapEventPlugin-test.internal.js @@ -86,13 +86,9 @@ describe('TapEventPlugin', () => { idCallOrder = []; tapMoveThreshold = TapEventPlugin.tapMoveThreshold; - expect(() => - EventPluginHub.injection.injectEventPluginsByName({ - TapEventPlugin: TapEventPlugin, - }), - ).toLowPriorityWarnDev( - 'Injecting custom event plugins (TapEventPlugin) is deprecated', - ); + EventPluginHub.injection.injectEventPluginsByName({ + TapEventPlugin: TapEventPlugin, + }); }); /** diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index a39bafdf24..a2576e2e70 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -1300,13 +1300,6 @@ const ReactDOM: Object = { }, }; -if (__DEV__) { - // Show deprecation warnings as we don't want to support injection forever. - // We do it now to let the internal injection happen without warnings. - // https://github.com/facebook/react/issues/11689 - EventPluginRegistry.enableWarningOnInjection(); -} - type RootOptions = { hydrate?: boolean, };