Home / Function/ fakeRequireNativeComponent() — react Function Reference

fakeRequireNativeComponent() — react Function Reference

Architecture documentation for the fakeRequireNativeComponent() function in ReactNativeEvents-test.internal.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  47fa5049_19c0_0926_284c_1a98b96c6893["fakeRequireNativeComponent()"]
  dbf4bc06_48b0_a04e_3608_0996340ffd0c["ReactNativeEvents-test.internal.js"]
  47fa5049_19c0_0926_284c_1a98b96c6893 -->|defined in| dbf4bc06_48b0_a04e_3608_0996340ffd0c
  style 47fa5049_19c0_0926_284c_1a98b96c6893 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js lines 25–63

const fakeRequireNativeComponent = (uiViewClassName, validAttributes) => {
  const getViewConfig = () => {
    const viewConfig = {
      uiViewClassName,
      validAttributes,
      bubblingEventTypes: {
        topTouchCancel: {
          phasedRegistrationNames: {
            bubbled: 'onTouchCancel',
            captured: 'onTouchCancelCapture',
          },
        },
        topTouchEnd: {
          phasedRegistrationNames: {
            bubbled: 'onTouchEnd',
            captured: 'onTouchEndCapture',
          },
        },
        topTouchMove: {
          phasedRegistrationNames: {
            bubbled: 'onTouchMove',
            captured: 'onTouchMoveCapture',
          },
        },
        topTouchStart: {
          phasedRegistrationNames: {
            bubbled: 'onTouchStart',
            captured: 'onTouchStartCapture',
          },
        },
      },
      directEventTypes: {},
    };

    return viewConfig;
  };

  return createReactNativeComponentClass(uiViewClassName, getViewConfig);
};

Domain

Subdomains

Frequently Asked Questions

What does fakeRequireNativeComponent() do?
fakeRequireNativeComponent() is a function in the react codebase, defined in packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js.
Where is fakeRequireNativeComponent() defined?
fakeRequireNativeComponent() is defined in packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free