import { act , create , ReactTestRenderer } from 'react-test-renderer' ; import { RendererProps , RendererOptions } from '../types/react' ; import { createRenderHook } from '../core' ; import { createTestHarness } from '../helpers/createTestHarness' ; function createNativeRenderer < TProps , TResult > ( rendererProps , { wrapper } ) { let container ; const testHarness = createTestHarness ( rendererProps , wrapper ) ; return { render ( props ? ) { act ( ( ) => { container = create ( testHarness ( props ) ) ; } ) ; } , rerender ( props ? ) { act ( ( ) => { container . update ( testHarness ( props ) ) ; } ) ; } , unmount ( ) { act ( ( ) => { container . unmount ( ) ; } ) ; } , act } ; } const renderHook = createRenderHook ( createNativeRenderer ) ; export { renderHook , act } ; export { cleanup , addCleanup , removeCleanup , suppressErrorOutput } from '../core' ; export * from '../types/react' ;