useReducer
на сайте с 07 апреля 2023, 04:06
useReducer is usually preferable to useState when you have complex state logic that involves multiple sub-values or when the next state depends on the previous ...