Skip to content

Commit 0fdcc4d

Browse files
authored
minor fixes in example-intro.md (testing-library#529)
Few minor things were missing when I was trying out.
1 parent 01d53fd commit 0fdcc4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/react-testing-library/example-intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ expect(screen.getByRole('button')).not.toHaveAttribute('disabled')
171171
fetch.js
172172

173173
```jsx
174-
import React, { useState } from 'react'
174+
import React, { useState, useReducer } from 'react'
175175
import axios from 'axios'
176176

177177
function greetingReducer(state, action) {
@@ -182,7 +182,7 @@ function greetingReducer(state, action) {
182182
greeting: action.greeting,
183183
}
184184
}
185-
case: 'ERROR': {
185+
case 'ERROR': {
186186
return {
187187
error: action.error,
188188
greeting: null
@@ -207,7 +207,7 @@ export default function Fetch({ url }) {
207207
setButtonClicked(true)
208208
})
209209
.catch((error) => {
210-
dispatch({ type: 'ERROR' })
210+
dispatch({ type: 'ERROR', error })
211211
})
212212
}
213213

0 commit comments

Comments
 (0)