DEV Community

loading...

Discussion on: Connect useEffect and useState to Update Components with Data

Collapse
chantastic profile image
Michael Chan Author

great question!

You could go either way, depending on your comfort with reducers.

I think the end result would impact my preference.
For example, I don't like having two pieces of state in a reducer that control the same outcome — index and pokemon.

I think it'd depend a lot of the final component whether I kept index or pokemon in the reducer.

I'll try to flesh that out a little more in the later lessons.

Thanks for asking!