You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -130,9 +130,8 @@ Renders a test component that will call the provided `callback`, including any h
130
130
#### Arguments
131
131
132
132
-`callback` (`function()`) - function to call each render. This function should call one or more hooks for testing.
133
-
-`options` (`object`):
133
+
-`options` (`object`) - accepts the [same options as `react-testing-library`'s `render` function](https://testing-library.com/docs/react-testing-library/api#render-options), as well as:
134
134
-`initialProps` (`object`) - the initial values to pass to the `callback` function
135
-
-`wrapper` (`Component`) - A component to wrap the underlying test component, commonly used to add context providers for the `useContext` hook. The component will recieve the test component as `children` and must render it.
136
135
137
136
#### Returns
138
137
@@ -141,6 +140,16 @@ Renders a test component that will call the provided `callback`, including any h
141
140
-`rerender` (`function([newProps])`) - function to rerender the test component including any hooks called in the `callback` function. If `newProps` are passed, the will replace the `initialProps` passed the the `callback` function for future renders.
142
141
-`unmount` (`function()`) - function to unmount the test component, commonly used to trigger cleanup effects for `useEffect` hooks.
143
142
143
+
### `cleanup()`
144
+
145
+
Unmounts any React trees that were mounted with [renderHook](#renderhookcallback-options).
146
+
147
+
This is the same [`cleanup` function](https://testing-library.com/docs/react-testing-library/api#cleanup) that is exported by `react-testing-library`.
148
+
149
+
### `act(callback)`
150
+
151
+
This is the same [`act` function](https://testing-library.com/docs/react-testing-library/api#act) that is exported by `react-testing-library`.
152
+
144
153
## Contributors
145
154
146
155
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
0 commit comments