Hacker News new | ask | show | jobs
by fennecbutt 351 days ago
Coming from Angular, too, I never really liked React.

Angular had dependency injection and that made things so nice to work with.

React ended up with Redux and then contexts, which imo are both hacks in reaction to realising who in the fuck wants to pass down a singleton service component which maintains say a db connection down from the root of the project through all the damn layers of the app.

Define it at root, use in leaves via dependency injection. With Angular it was that simple.

Jsx/tsx was always hella cool though, I appreciate writing the v in the c, often with m. Angular from what I can recall was still very much mc, v.

1 comments

Context is pretty much DI, but it works with the component tree - I can wrap different subtrees in different providers. This is much more powerful than angular style dependency injection and there have been several times where I was really grateful for it.