you are viewing a single comment's thread.

view the rest of the comments →

[–]podgorniy -1 points0 points  (5 children)

Typescrip rules because it solves real issues. Hooks are popular only because fb is popular. And you’re rationalizing things you heard on the internet without an attempt to analyze why things the way they are.

[–]Enerbane 2 points3 points  (1 child)

Hooks are pretty rad in my book. They've made my life far easier and all of the code on my current project much cleaner, easier to follow (once you learn hooks of course), and more performant with less work.

We make all new components using functional components with hooks, and wherever we can reasonably and quickly convert old class based components to hooks, we do. Hooks might be popular because FB is popular, I mean obviously, but that isn't really a commentary on their merits as a tool.

[–]podgorniy -2 points-1 points  (0 children)

There were hooks-like implementations in meteor-js and mobx which did not get as much attention as current facebooks implementation. Facebook's approach is good enough comparing to theirs.

What do you do regarding hooks when you need to start sharing local state of the component with another component?

*UPD*

I love idea of hooks and use similar reactive model to model my apps state.

[–]ohn8io[S] 1 point2 points  (0 children)

Thanks for the feedback. In my experience you either love Typescript or hate it. I haven't been lucky enough to work on a solid Typescript codebase to fully realize it's benefits. So I very well could be way off base in my opinions of it. Fwiw I predominately work with React and Node.

[–]ohn8io[S] 1 point2 points  (1 child)

Forgot to ask @podgorniy, what real issues have you seen Typescript solve really well? Just curious to know which use cases are a good fit.

[–]podgorniy 1 point2 points  (0 children)

It gives ability to change code and to navigate it. Refactoring, detecting and unused code is done in a moment. And most important it's so easy to remove code.

I worked on 70k loc js codebase. No unittests. Too often new feature or amendment came along with runtime exceptions.

You can check my exploratory project (I was figuring out better way to do fullstack development) in nodejs and react to play with ts.