ReactFabric-test.internal.js — react Source File
Architecture documentation for ReactFabric-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 ReactNativePrivateInterface;
let createReactNativeComponentClass;
let StrictMode;
let act;
let assertConsoleErrorDev;
const DISPATCH_COMMAND_REQUIRES_HOST_COMPONENT =
"dispatchCommand was called with a ref that isn't a " +
'native component. Use React.forwardRef to get access to the underlying native component';
const SEND_ACCESSIBILITY_EVENT_REQUIRES_HOST_COMPONENT =
"sendAccessibilityEvent was called with a ref that isn't a " +
'native component. Use React.forwardRef to get access to the underlying native component';
describe('ReactFabric', () => {
beforeEach(() => {
jest.resetModules();
require('react-native/Libraries/ReactPrivate/InitializeNativeFabricUIManager');
React = require('react');
StrictMode = React.StrictMode;
ReactFabric = require('react-native-renderer/fabric');
ReactNativePrivateInterface = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface');
createReactNativeComponentClass =
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
.ReactNativeViewConfigRegistry.register;
({act, assertConsoleErrorDev} = require('internal-test-utils'));
});
it('should be able to create and render a native component', async () => {
const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {foo: true},
uiViewClassName: 'RCTView',
}));
await act(() => {
ReactFabric.render(<View foo="test" />, 1, null, true);
});
expect(nativeFabricUIManager.createNode).toBeCalled();
expect(nativeFabricUIManager.appendChild).not.toBeCalled();
expect(nativeFabricUIManager.completeRoot).toBeCalled();
});
it('should be able to create and update a native component', async () => {
const View = createReactNativeComponentClass('RCTView', () => ({
// ... (1446 more lines)
Domain
Subdomains
Source
Frequently Asked Questions
What does ReactFabric-test.internal.js do?
ReactFabric-test.internal.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
Where is ReactFabric-test.internal.js in the architecture?
ReactFabric-test.internal.js is located at packages/react-native-renderer/src/__tests__/ReactFabric-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