Comment

Comment by mrozbarry

One thing that baffles me is that no one has brought up that hooks don't have an obvious context.

For instance, if I have a single app and component, and use a hook, I understand that the hook and app have some sort of implicit connection.

But what happens when I have two distinct react apps on a page - does that break the ordering that hooks require? How does a hook have any affinity to the app, or does that even matter?

I'm sure looking at the code will cause a "oh, I get it" moment, but that doesn't mean it's obvious to anyone just picking up hooks.

Honestly, I think hooks are fine, but I'd almost prefer a signature like `const MyComponent = (props, { ...hooksHere })` so there's at least a false affinity between the application and the component.

parent mrozbarry 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton