Live data from Hacker News

A Critique of React Hooks Addendum

dillonshook.com

1–10 of 56 posts

Re: A Critique of React Hooks Addendum

#4
Maybe a good place to ask this:

I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense.

Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that.

Like... what? How... how does that explain what you're doing? One of these things is not like the other. "Oh we don't use doors on our buildings anymore, we've switched entirely over to trees". Huh? What the actual hell does that mean?

Re: A Critique of React Hooks Addendum

#5

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

They might be using context. The problem with that though is it will cause performance issues due to unintentional rerendering. Not something to worry about for a small app.

https://reactjs.org/docs/context.html

Re: A Critique of React Hooks Addendum

#6

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

Perhaps they mean instead of Redux, they are using Context + useReducer.

Re: A Critique of React Hooks Addendum

#7

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

I'd guess comments like this come from people thinking the primary complexity of Redux is the data store, rather than the "all changes to your state are represented as plain objects". The Redux FAQ goes into this: https://redux.js.org/faq/general#when-should-i-use-redux

Can't blame them missing the forest for the trees when you spend all your time writing the reducers and connectors vs the actions themselves.

Re: A Critique of React Hooks Addendum

#8

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

I can't say for sure what they mean, but I'd guess it's saying they keep shared state in a parent component rather than having a global data store for their app. The useState hook might explain their chosen wording.

Re: A Critique of React Hooks Addendum

#9

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

This might be of benefit: https://blog.logrocket.com/use-hooks-and-context-not-react-a...

If Redux is a a vanilla-ish JS store and a Reactified access pattern, keeping the store but replacing the access pattern with React Contexts.

I am not a React expert.

Re: A Critique of React Hooks Addendum

#10

Maybe a good place to ask this: I've been hearing a lot of "oh we don't use Redux, we use hooks" lately, as if this obviously makes sense. Am I missing something? To me this seems like "oh we don't use Redux, we use arrays". I'm gonna need quite a few more details before I can make any sense of a statement like that. Like... what? How... how does that explain what you're doing? One of these things is not like the oth…

They might be using context. The problem with that though is it will cause performance issues due to unintentional rerendering. Not something to worry about for a small app. https://reactjs.org/docs/context.html

Are people just using "hooks" to mean "all new functionality in React that happens to be available to/as hooks"? To me it's like (actually very like) "oh we're doing that with methods". Uh. OK? Cool I guess? That's not informative.
Post reply on HN