Skip to content

Commit

Permalink
[Flare] Bring Flare support to React Native Fabric (#15887)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Jun 28, 2019
1 parent 9b0bd43 commit eb2ace1
Show file tree
Hide file tree
Showing 13 changed files with 1,680 additions and 27 deletions.
6 changes: 3 additions & 3 deletions packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,19 @@ export function unhideTextInstance(textInstance, text): void {
}

export function mountEventComponent(
eventComponentInstance: ReactEventComponentInstance,
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
) {
throw new Error('Not yet implemented.');
}

export function updateEventComponent(
eventComponentInstance: ReactEventComponentInstance,
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
) {
throw new Error('Not yet implemented.');
}

export function unmountEventComponent(
eventComponentInstance: ReactEventComponentInstance,
eventComponentInstance: ReactEventComponentInstance<any, any, any>,
): void {
throw new Error('Not yet implemented.');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
setEnabled as ReactBrowserEventEmitterSetEnabled,
} from '../events/ReactBrowserEventEmitter';
import {getChildNamespace} from '../shared/DOMNamespaces';
import {addRootEventTypesForComponentInstance} from '../events/DOMEventResponderSystem';
import {
ELEMENT_NODE,
TEXT_NODE,
Expand All @@ -48,6 +47,7 @@ import type {
ReactDOMEventComponentInstance,
} from 'shared/ReactDOMTypes';
import {
addRootEventTypesForComponentInstance,
mountEventResponder,
unmountEventResponder,
} from '../events/DOMEventResponderSystem';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/DOMEventResponderSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const eventResponderContext: ReactDOMResponderContext = {
}
return false;
},
isTargetWithinElement(
isTargetWithinNode(
childTarget: Element | Document,
parentTarget: Element | Document,
): boolean {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export function dispatchEvent(
targetInst,
);
} else {
// Responder event system (experimental event API)
// React Flare event system
dispatchEventForResponderEventSystem(
topLevelType,
targetInst,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Component instance.

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

### isTargetWithinElement(target: Element, element: Element): boolean
### isTargetWithinNode(target: Element, element: Element): boolean

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

Expand Down
6 changes: 3 additions & 3 deletions packages/react-events/src/dom/Press.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ const PressResponder: ReactDOMEventResponder = {
if (
state.pressTarget !== null &&
(pointerType !== 'mouse' ||
!context.isTargetWithinElement(target, state.pressTarget))
!context.isTargetWithinNode(target, state.pressTarget))
) {
// Calculate the responder region we use for deactivation, as the
// element dimensions may have changed since activation.
Expand Down Expand Up @@ -936,7 +936,7 @@ const PressResponder: ReactDOMEventResponder = {
!isKeyboardEvent &&
state.pressTarget !== null &&
(pointerType !== 'mouse' ||
!context.isTargetWithinElement(target, state.pressTarget))
!context.isTargetWithinNode(target, state.pressTarget))
) {
// If the event target isn't within the press target, check if we're still
// within the responder region. The region may have changed if the
Expand Down Expand Up @@ -993,7 +993,7 @@ const PressResponder: ReactDOMEventResponder = {
if (
pressTarget !== null &&
(scrollTarget === doc ||
context.isTargetWithinElement(pressTarget, scrollTarget))
context.isTargetWithinNode(pressTarget, scrollTarget))
) {
dispatchCancel(event, context, props, state);
}
Expand Down

0 comments on commit eb2ace1

Please sign in to comment.