File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed 
docs/react-testing-library Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ expect(screen.getByRole('button')).not.toHaveAttribute('disabled')
171171fetch.js
172172
173173``` jsx 
174- import  React , { useState  } from  ' react' 
174+ import  React , { useState ,  useReducer  } from  ' react' 
175175import  axios  from  ' axios' 
176176
177177function  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
                         You can’t perform that action at this time. 
           
                  
0 commit comments