@@ -13,12 +13,11 @@ import { renderWithAct } from './render-act';
13
13
import { setRenderResult , screen } from './screen' ;
14
14
import { getQueriesForElement } from './within' ;
15
15
16
- export type RenderOptions = {
16
+ export interface RenderOptions {
17
17
wrapper ?: React . ComponentType < any > ;
18
18
createNodeMock ?: ( element : React . ReactElement ) => any ;
19
19
unstable_validateStringsRenderedWithinText ?: boolean ;
20
- skipHostComponentNamesConfiguration ?: boolean ;
21
- } ;
20
+ }
22
21
23
22
export type RenderResult = ReturnType < typeof render > ;
24
23
@@ -27,15 +26,29 @@ export type RenderResult = ReturnType<typeof render>;
27
26
* to assert on the output.
28
27
*/
29
28
export default function render < T > (
29
+ component : React . ReactElement < T > ,
30
+ options : RenderOptions = { }
31
+ ) {
32
+ return renderInternal ( component , {
33
+ ...options ,
34
+ detectHostComponentNames : true ,
35
+ } ) ;
36
+ }
37
+
38
+ export interface RenderInternalOptions extends RenderOptions {
39
+ detectHostComponentNames ?: boolean ;
40
+ }
41
+
42
+ export function renderInternal < T > (
30
43
component : React . ReactElement < T > ,
31
44
{
32
45
wrapper : Wrapper ,
33
46
createNodeMock,
34
47
unstable_validateStringsRenderedWithinText,
35
- skipHostComponentNamesConfiguration = false ,
36
- } : RenderOptions = { }
48
+ detectHostComponentNames = false ,
49
+ } : RenderInternalOptions = { }
37
50
) {
38
- if ( skipHostComponentNamesConfiguration === false ) {
51
+ if ( detectHostComponentNames ) {
39
52
configureHostComponentNamesIfNeeded ( ) ;
40
53
}
41
54
0 commit comments