()
| 37 | } |
| 38 | |
| 39 | export default function Demo() { |
| 40 | const [state, dispatch] = useReducer(reducer, { |
| 41 | count: 0, |
| 42 | error: null, |
| 43 | }); |
| 44 | |
| 45 | return ( |
| 46 | <div className='tutorial'> |
| 47 | <div>Count: {state.count}</div> |
| 48 | {state.error && <div className='mb-2 text-red-500'>{state.error}</div>} |
| 49 | <button className='mb-2' onClick={() => dispatch({ type: 'increment' })}> |
| 50 | Increment |
| 51 | </button> |
| 52 | <button onClick={() => dispatch({ type: 'decrement' })}>Decrement</button> |
| 53 | </div> |
| 54 | ); |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected