public void setJSResponder(int reactTag, int initialReactTag, boolean blockNativeResponder) { if (!blockNativeResponder) { mJSResponderHandler.setJSResponder(initialReactTag, null); return; } View view = mTagsToViews.get(reactTag); if (initialReactTag != reactTag && view instanceof ViewParent) { // In this case, initialReactTag corresponds to a virtual/layout-only View, and we already // have a parent of that View in reactTag, so we can use it. mJSResponderHandler.setJSResponder(initialReactTag, (ViewParent) view); return; } if (mRootTags.get(reactTag)) { SoftAssertions.assertUnreachable( "Cannot block native responder on " + reactTag + " that is a root view"); } mJSResponderHandler.setJSResponder(initialReactTag, view.getParent()); }
public void clearJSResponder() { mJSResponderHandler.clearJSResponder(); }