I'm currently studying this pattern and I was wondering what could be the utility of having a state reducer prop. In this example we are initializing our on state with initial props and telling the user about state changes using onStateChange prop and not using the state reducer at all. I guess the state reducer could be useful to also manage different pieces of state internally. Thus, having controlled and non-controlled properties at the same time. Is this the utility of the pattern?
Hello!
I'm currently studying this pattern and I was wondering what could be the utility of having a state reducer prop. In this example we are initializing our
on
state with initial props and telling the user about state changes usingonStateChange
prop and not using the state reducer at all. I guess the state reducer could be useful to also manage different pieces of state internally. Thus, having controlled and non-controlled properties at the same time. Is this the utility of the pattern?Thanks for this very useful course.