React 18 is now in beta
github.com
github.com
Especially with https://github.com/facebook/prepack. They want to eventually ship pre-compiled components rather than React.createElement() to end user
Example from real experience: I had an `InfinityScroller` functional component. The `loadMoreItems` prop signature was a function with ten arguments because different usages require different state data when deciding what to load.
I converted the component to class based. `loadMoreItems` became an abstract method. No more overly complicated type signature because I can just access and update `this.state`.
I know how to build testable class based components. I dread the idea of modeling the fine behavior of hooks.
I like objects as a place to hang event handlers. I hate seeing setState in lambdas inside a render() method. For one thing it gets in the way of rapid scanning of the code to know that somebody didn't slip a rogue setState into the render method (have to look at that punctuation.) Another one is that often the exact same behavior gets bound in four places or very similar behavior is bound in 15 places.
I see the hooks as treacherous. On one hand they masquerade as ‘functional’ (will never hear the end of noobs who think they are doing ‘functional programming’) but the order in which the functions are called matters for hooks.
Probably some hooks are properly written but I don’t have a lot of faith; I see so many systems in React that are a house of cards and only work by accidents and hooks seems like a great way to keep that tradition going.