Amy Blankenship
Mar 21, 2022

--

I think the real problem is that hooks now turn functions into classes. The whole reason functional programming is nice is because there is no state. As soon as you add state, you're losing the thing that made you want to do this.

And then hooks glomming onto Redux just totally miss the point of what state management ought to be doing--it's basically treating Redux like an old-school Singleton, complete with all the brittleness that we used to experience.

So you need to move the wiring to Redux out of your component, whether you do that with old-school mapStateToProps and mapDispatchToProps or you invent and maintain your own flavor of middleware doesn't matter. It's just we have a real architectural issue created by the fad of moving everything to hooks, without any concern with the old issues of the past this will recreate.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)