Skip to content

Commit 8605224

Browse files
author
Kent C. Dodds
authored
docs: ensure options spreads correctly
1 parent d4f4b05 commit 8605224

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,14 @@ import {ThemeProvider} from 'my-ui-lib'
244244
import {TranslationProvider} from 'my-i18n-lib'
245245
import defaultStrings from 'i18n/en-x-default'
246246

247-
const customRender = (node, ...options) => {
247+
const customRender = (node, options) => {
248248
return render(
249249
<ThemeProvider theme="light">
250250
<TranslationProvider messages={defaultStrings}>
251251
{node}
252252
</TranslationProvider>
253253
</ThemeProvider>,
254-
...options,
254+
options,
255255
)
256256
}
257257

@@ -314,7 +314,7 @@ return value of the customRender.
314314
```js
315315
// test-utils.js
316316

317-
const customRender = (node, ...options) => {
317+
const customRender = (node, options) => {
318318
const rendered = render(<div>{node}</div>, options)
319319
return {
320320
...rendered,
@@ -339,7 +339,7 @@ You can use CommonJS modules instead of ES modules, which should work in Node:
339339
// test-utils.js
340340
const rtl = require('react-testing-library')
341341

342-
const customRender = (node, ...options) => {
342+
const customRender = (node, options) => {
343343
return rtl.render(<Something>{node}</Something>)
344344
}
345345

@@ -640,8 +640,8 @@ export function getByTestId(...args) {
640640
return queryHelpers.firstResultOrNull(getAllByTestId, ...args)
641641
}
642642

643-
const customRender = (container, ...options) => {
644-
const utils = render(container, ...options)
643+
const customRender = (container, options) => {
644+
const utils = render(container, options)
645645

646646
return {
647647
...utils,

0 commit comments

Comments
 (0)