Files
react/packages/react-native-renderer/src/__tests__/ReactNativeError-test.internal.js
T
Timothy Yung a3d9ea05bf Delete __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED from React Native Renderer (#31276)
## Summary

The React Native Renderer exports a
`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED` property with a
single method that has no remaining call sites:
`computeComponentStackForErrorReporting`

This PR cleans up this unused export.

## How did you test this change?

```
$ yarn
$ yarn flow fabric
$ yarn test
```
2024-10-16 11:19:01 -07:00

36 lines
917 B
JavaScript

/**
* 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 createReactNativeComponentClass;
describe('ReactNativeError', () => {
beforeEach(() => {
jest.resetModules();
createReactNativeComponentClass =
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
.ReactNativeViewConfigRegistry.register;
});
it('should throw error if null component registration getter is used', () => {
expect(() => {
try {
createReactNativeComponentClass('View', null);
} catch (e) {
throw new Error(e.toString());
}
}).toThrow(
'View config getter callback for component `View` must be a function (received `null`)',
);
});
});