@@ -13,27 +13,41 @@ import { renderWithAct } from './render-act';
1313import { setRenderResult , screen } from './screen' ;
1414import { getQueriesForElement } from './within' ;
1515
16- export type RenderOptions = {
16+ export interface RenderOptions {
1717 wrapper ?: React . ComponentType < any > ;
1818 createNodeMock ?: ( element : React . ReactElement ) => any ;
1919 unstable_validateStringsRenderedWithinText ?: boolean ;
20- } ;
20+ }
2121
2222export type RenderResult = ReturnType < typeof render > ;
2323
2424/**
25- * Renders test component deeply using react-test-renderer and exposes helpers
25+ * Renders test component deeply using React Test Renderer and exposes helpers
2626 * to assert on the output.
2727 */
2828export default function render < T > (
29+ component : React . ReactElement < T > ,
30+ options : RenderOptions = { }
31+ ) {
32+ return renderInternal ( component , options ) ;
33+ }
34+
35+ export interface RenderInternalOptions extends RenderOptions {
36+ detectHostComponentNames ?: boolean ;
37+ }
38+
39+ export function renderInternal < T > (
2940 component : React . ReactElement < T > ,
3041 {
3142 wrapper : Wrapper ,
3243 createNodeMock,
3344 unstable_validateStringsRenderedWithinText,
34- } : RenderOptions = { }
45+ detectHostComponentNames = true ,
46+ } : RenderInternalOptions = { }
3547) {
36- configureHostComponentNamesIfNeeded ( ) ;
48+ if ( detectHostComponentNames ) {
49+ configureHostComponentNamesIfNeeded ( ) ;
50+ }
3751
3852 if ( unstable_validateStringsRenderedWithinText ) {
3953 return renderWithStringValidation ( component , {
0 commit comments