usereducerReactUsereducerMediumWhen is useReducer preferable to useState?1When state logic is complex with multiple sub-values or next state depends on the previous2When there is a single boolean flag3When you never update state4Only in class componentsBack to list