Skip to content

Commit

Permalink
Drop ShallowRenderer changes for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Pope committed Feb 16, 2024
1 parent ba73be6 commit e24023b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 75 deletions.
25 changes: 2 additions & 23 deletions packages/react-test-renderer/shallow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import ReactShallowRenderer from 'react-shallow-renderer';
import {enableReactTestRendererWarning} from 'shared/ReactFeatureFlags';

let Renderer = ReactShallowRenderer;

if (enableReactTestRendererWarning === true) {
const emptyObject = {};
Renderer = class ReactShallowRendererWithWarning extends (
ReactShallowRenderer
) {
render(element, context = emptyObject) {
if (__DEV__) {
console.warn(
'react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer',
);
}

return super.render(element, context);
}
};
}

export default Renderer;
export {default} from 'react-shallow-renderer';

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const disableClientCache = true;
export const enableServerComponentKeys = true;
export const enableInfiniteRenderLoopDetection = false;

export const enableReactTestRendererWarning = false;
export const enableReactTestRendererWarning = true;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

0 comments on commit e24023b

Please sign in to comment.