RenderHookOptions
Properties
Defaults to the container if the container is specified. Otherwise document.body is used for the default. This is used as the base element for the queries as well as what is printed when you use debug().
By default, React Testing Library will create a div and append that div to the document.body. Your React component will be rendered in the created div. If you provide your own HTMLElement container via this option, it will not be appended to the document.body automatically.
The argument passed to the renderHook callback. Can be useful if you plan to use the rerender utility to change the values passed to your hook.
Only works if used with React 18. Set to true if you want to force synchronous ReactDOM.render. Otherwise render will default to concurrent React if available.
Only supported in React 19. Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack.
Callback called when React automatically recovers from errors. Called with an error React throws, and an errorInfo object containing the componentStack. Some recoverable errors may include the original error cause as error.cause.
Not supported at the moment
When enabled, reactStrictMode set in configure.