Skip to content

Commit eb2ace1

Browse files
authored
[Flare] Bring Flare support to React Native Fabric (facebook#15887)
1 parent 9b0bd43 commit eb2ace1

File tree

13 files changed

+1680
-27
lines changed

13 files changed

+1680
-27
lines changed

packages/react-art/src/ReactARTHostConfig.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,19 @@ export function unhideTextInstance(textInstance, text): void {
428428
}
429429

430430
export function mountEventComponent(
431-
eventComponentInstance: ReactEventComponentInstance,
431+
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
432432
) {
433433
throw new Error('Not yet implemented.');
434434
}
435435

436436
export function updateEventComponent(
437-
eventComponentInstance: ReactEventComponentInstance,
437+
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
438438
) {
439439
throw new Error('Not yet implemented.');
440440
}
441441

442442
export function unmountEventComponent(
443-
eventComponentInstance: ReactEventComponentInstance,
443+
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
444444
): void {
445445
throw new Error('Not yet implemented.');
446446
}

packages/react-dom/src/client/ReactDOMHostConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
setEnabled as ReactBrowserEventEmitterSetEnabled,
3333
} from '../events/ReactBrowserEventEmitter';
3434
import {getChildNamespace} from '../shared/DOMNamespaces';
35-
import {addRootEventTypesForComponentInstance} from '../events/DOMEventResponderSystem';
3635
import {
3736
ELEMENT_NODE,
3837
TEXT_NODE,
@@ -48,6 +47,7 @@ import type {
4847
ReactDOMEventComponentInstance,
4948
} from 'shared/ReactDOMTypes';
5049
import {
50+
addRootEventTypesForComponentInstance,
5151
mountEventResponder,
5252
unmountEventResponder,
5353
} from '../events/DOMEventResponderSystem';

packages/react-dom/src/events/DOMEventResponderSystem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const eventResponderContext: ReactDOMResponderContext = {
231231
}
232232
return false;
233233
},
234-
isTargetWithinElement(
234+
isTargetWithinNode(
235235
childTarget: Element | Document,
236236
parentTarget: Element | Document,
237237
): boolean {

packages/react-dom/src/events/ReactDOMEventListener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export function dispatchEvent(
332332
targetInst,
333333
);
334334
} else {
335-
// Responder event system (experimental event API)
335+
// React Flare event system
336336
dispatchEventForResponderEventSystem(
337337
topLevelType,
338338
targetInst,

packages/react-events/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Component instance.
121121

122122
Returns `true` if the instance has taken ownership of the responder.
123123

124-
### isTargetWithinElement(target: Element, element: Element): boolean
124+
### isTargetWithinNode(target: Element, element: Element): boolean
125125

126126
Returns `true` if `target` is a child of `element`.
127127

packages/react-events/src/dom/Press.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ const PressResponder: ReactDOMEventResponder = {
823823
if (
824824
state.pressTarget !== null &&
825825
(pointerType !== 'mouse' ||
826-
!context.isTargetWithinElement(target, state.pressTarget))
826+
!context.isTargetWithinNode(target, state.pressTarget))
827827
) {
828828
// Calculate the responder region we use for deactivation, as the
829829
// element dimensions may have changed since activation.
@@ -936,7 +936,7 @@ const PressResponder: ReactDOMEventResponder = {
936936
!isKeyboardEvent &&
937937
state.pressTarget !== null &&
938938
(pointerType !== 'mouse' ||
939-
!context.isTargetWithinElement(target, state.pressTarget))
939+
!context.isTargetWithinNode(target, state.pressTarget))
940940
) {
941941
// If the event target isn't within the press target, check if we're still
942942
// within the responder region. The region may have changed if the
@@ -993,7 +993,7 @@ const PressResponder: ReactDOMEventResponder = {
993993
if (
994994
pressTarget !== null &&
995995
(scrollTarget === doc ||
996-
context.isTargetWithinElement(pressTarget, scrollTarget))
996+
context.isTargetWithinNode(pressTarget, scrollTarget))
997997
) {
998998
dispatchCancel(event, context, props, state);
999999
}

0 commit comments

Comments
 (0)