File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ import {
4242} from 'react-reconciler/inline.dom' ;
4343import { createPortal as createPortalImpl } from 'shared/ReactPortal' ;
4444import { canUseDOM } from 'shared/ExecutionEnvironment' ;
45- import createEvent from 'shared/createEventComponent' ;
4645import { setBatchingImplementation } from 'events/ReactGenericBatching' ;
4746import {
4847 setRestoreImplementation ,
@@ -64,10 +63,7 @@ import getComponentName from 'shared/getComponentName';
6463import invariant from 'shared/invariant' ;
6564import lowPriorityWarning from 'shared/lowPriorityWarning' ;
6665import warningWithoutStack from 'shared/warningWithoutStack' ;
67- import {
68- enableStableConcurrentModeAPIs ,
69- enableEventAPI ,
70- } from 'shared/ReactFeatureFlags' ;
66+ import { enableStableConcurrentModeAPIs } from 'shared/ReactFeatureFlags' ;
7167
7268import {
7369 getInstanceFromNode ,
@@ -881,10 +877,6 @@ if (enableStableConcurrentModeAPIs) {
881877 ReactDOM . createSyncRoot = createSyncRoot ;
882878}
883879
884- if ( enableEventAPI ) {
885- ReactDOM . unstable_createEvent = createEvent ;
886- }
887-
888880const foundDevTools = injectIntoDevTools ( {
889881 findFiberByHostInstance : getClosestInstanceFromNode ,
890882 bundleType : __DEV__ ? 1 : 0 ,
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ function createReactEventComponent({
4545 allowEventHooks : allowEventHooks || true ,
4646 } ;
4747
48- return ReactDOM . unstable_createEvent ( testEventResponder ) ;
48+ return React . unstable_createEvent ( testEventResponder ) ;
4949}
5050
5151const createEvent = ( type , data ) => {
Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ import invariant from 'shared/invariant';
7070import lowPriorityWarning from 'shared/lowPriorityWarning' ;
7171import warningWithoutStack from 'shared/warningWithoutStack' ;
7272import { enableStableConcurrentModeAPIs } from 'shared/ReactFeatureFlags' ;
73- import createEvent from 'shared/createEventComponent' ;
7473
7574import {
7675 getInstanceFromNode ,
@@ -87,7 +86,6 @@ import {
8786 DOCUMENT_FRAGMENT_NODE ,
8887} from '../shared/HTMLNodeType' ;
8988import { ROOT_ATTRIBUTE_NAME } from '../shared/DOMProperty' ;
90- import { enableEventAPI } from 'shared/ReactFeatureFlags' ;
9189
9290const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
9391
@@ -885,10 +883,6 @@ if (enableStableConcurrentModeAPIs) {
885883 ReactDOM . createSyncRoot = createSyncRoot ;
886884}
887885
888- if ( enableEventAPI ) {
889- ReactDOM . unstable_createEvent = createEvent ;
890- }
891-
892886const foundDevTools = injectIntoDevTools ( {
893887 findFiberByHostInstance : getClosestInstanceFromNode ,
894888 bundleType : __DEV__ ? 1 : 0 ,
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ can be found [here](./docs).
1212
1313## EventComponent
1414
15- An Event Component is defined using ` ReactDOM .unstable_createEvent` :
15+ An Event Component is defined using ` React .unstable_createEvent` :
1616
1717``` js
18- const EventComponent = ReactDOM .unstable_createEvent (
18+ const EventComponent = React .unstable_createEvent (
1919 responder: EventResponder,
2020 displayName: string
2121);
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type {
1313} from 'shared/ReactDOMTypes' ;
1414import type { EventPriority } from 'shared/ReactTypes' ;
1515
16- import ReactDOM from 'react-dom ' ;
16+ import React from 'react' ;
1717import { DiscreteEvent , UserBlockingEvent } from 'shared/ReactTypes' ;
1818
1919const targetEventTypes = [ 'pointerdown' ] ;
@@ -261,4 +261,4 @@ const DragResponder = {
261261 } ,
262262} ;
263263
264- export default ReactDOM . unstable_createEvent ( DragResponder ) ;
264+ export default React . unstable_createEvent ( DragResponder ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type {
1313 PointerType ,
1414} from 'shared/ReactDOMTypes' ;
1515
16- import ReactDOM from 'react-dom ' ;
16+ import React from 'react' ;
1717import { DiscreteEvent } from 'shared/ReactTypes' ;
1818
1919type FocusProps = {
@@ -338,4 +338,4 @@ const FocusResponder = {
338338 } ,
339339} ;
340340
341- export default ReactDOM . unstable_createEvent ( FocusResponder ) ;
341+ export default React . unstable_createEvent ( FocusResponder ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
1111 ReactDOMResponderContext ,
1212} from 'shared/ReactDOMTypes' ;
1313
14- import ReactDOM from 'react-dom ' ;
14+ import React from 'react' ;
1515
1616type FocusScopeProps = {
1717 autoFocus : Boolean ,
@@ -159,4 +159,4 @@ const FocusScopeResponder = {
159159 } ,
160160} ;
161161
162- export default ReactDOM . unstable_createEvent ( FocusScopeResponder ) ;
162+ export default React . unstable_createEvent ( FocusScopeResponder ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import type {
1212 ReactDOMResponderContext ,
1313} from 'shared/ReactDOMTypes' ;
1414
15- import ReactDOM from 'react-dom ' ;
15+ import React from 'react' ;
1616import { UserBlockingEvent } from 'shared/ReactTypes' ;
1717
1818type HoverProps = {
@@ -408,4 +408,4 @@ const HoverResponder = {
408408 } ,
409409} ;
410410
411- export default ReactDOM . unstable_createEvent ( HoverResponder ) ;
411+ export default React . unstable_createEvent ( HoverResponder ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import type {
1414} from 'shared/ReactDOMTypes' ;
1515import type { EventPriority } from 'shared/ReactTypes' ;
1616
17- import ReactDOM from 'react-dom ' ;
17+ import React from 'react' ;
1818import { DiscreteEvent , UserBlockingEvent } from 'shared/ReactTypes' ;
1919
2020type PressProps = {
@@ -981,4 +981,4 @@ const PressResponder = {
981981 } ,
982982} ;
983983
984- export default ReactDOM . unstable_createEvent ( PressResponder ) ;
984+ export default React . unstable_createEvent ( PressResponder ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import type {
1515import { UserBlockingEvent } from 'shared/ReactTypes' ;
1616import type { EventPriority } from 'shared/ReactTypes' ;
1717
18- import ReactDOM from 'react-dom ' ;
18+ import React from 'react' ;
1919
2020type ScrollProps = {
2121 disabled : boolean ,
@@ -213,4 +213,4 @@ const ScrollResponder = {
213213 } ,
214214} ;
215215
216- export default ReactDOM . unstable_createEvent ( ScrollResponder ) ;
216+ export default React . unstable_createEvent ( ScrollResponder ) ;
You can’t perform that action at this time.
0 commit comments