ReactFabricAndNative-test.internal.js — react Source File
Architecture documentation for ReactFabricAndNative-test.internal.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails react-core
* @jest-environment node
*/
'use strict';
let React;
let ReactFabric;
let ReactNative;
let UIManager;
let createReactNativeComponentClass;
let ReactNativePrivateInterface;
let getNativeTagFromPublicInstance;
describe('created with ReactFabric called with ReactNative', () => {
beforeEach(() => {
jest.resetModules();
require('react-native/Libraries/ReactPrivate/InitializeNativeFabricUIManager');
ReactNative = require('react-native-renderer');
jest.resetModules();
ReactNativePrivateInterface = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface');
UIManager =
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').UIManager;
jest.mock('shared/ReactFeatureFlags', () =>
require('shared/forks/ReactFeatureFlags.native-oss'),
);
React = require('react');
ReactFabric = require('react-native-renderer/fabric');
createReactNativeComponentClass =
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
.ReactNativeViewConfigRegistry.register;
getNativeTagFromPublicInstance =
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').getNativeTagFromPublicInstance;
});
it('find Fabric instances with the RN renderer', () => {
const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {title: true},
uiViewClassName: 'RCTView',
}));
const ref = React.createRef();
class Component extends React.Component {
render() {
return <View title="foo" />;
}
}
ReactFabric.render(<Component ref={ref} />, 11);
const instance = ReactNative.findHostInstance_DEPRECATED(ref.current);
expect(getNativeTagFromPublicInstance(instance)).toBe(2);
// ... (172 more lines)
Domain
Subdomains
Classes
Source
Frequently Asked Questions
What does ReactFabricAndNative-test.internal.js do?
ReactFabricAndNative-test.internal.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
Where is ReactFabricAndNative-test.internal.js in the architecture?
ReactFabricAndNative-test.internal.js is located at packages/react-native-renderer/src/__tests__/ReactFabricAndNative-test.internal.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-native-renderer/src/__tests__).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free