This shows how to use use_reducer to implement a simple calculator.
use_reducer
Note that the reducer implements all the logic of the calculator, and the Calculator component is just a thin wrapper around it.
reducer
Calculator