React is starting to turn from a novel, but essentially simple idea into a clusterfuck mess.
Edit: No really, I'd like to hear why you think this would make React a "clusterfuck mess" rather than... simpler.
11–20 of 310 posts
React is starting to turn from a novel, but essentially simple idea into a clusterfuck mess.
Edit: No really, I'd like to hear why you think this would make React a "clusterfuck mess" rather than... simpler.
A demonstration of Hooks is live right now at ReactConf and looks very cool: https://www.youtube.com/watch?v=kz3nVya45uQ (go back about 1.5 hrs into the past to see the start of the demo).
If you like live coding demos, he also gave a talk at JSConf Iceland where he showed off some future React features, such as asynchronous rendering: https://www.youtube.com/watch?v=nLF0n9SACd4
Is it just a syntactical difference or is there something more fundamental that I'm missing here?
It's the same concepts of props, state, context, and lifecycle behavior as before.
It's just that now you can do it in function components, not just class components, and the APIs let you handle things without having to have additional levels of wrapper components and without the complexity of class-related gotchas.
While I appreciate the functional usage of state, this type of magical behavior worries me a bit. Wasn't more straightforward semantics possible (even if the syntax wasn't similarly straightforward)?
While I agree that class components has always felt like a workaround to bypass the limitations of function components, and that it's obviously annoying to rewrite a function component to a class component just to add a state or a lifecycle method, the following explanation sounds a bit silly to me: > In our observation, classes are the biggest barrier to learning React. You have to understand how this works in JavaS…
(Also, I'm pretty fluent in Javascript and I still forget to bind event handlers all the time, which suggests to me that it's a counterintuitive pattern even if I know "how it works" on a technical level. And you either have to put a bunch of "this.handler = this.handler.bind(this)" in the constructor, or rely on class properties which are an unstable syntax feature, both of which are suboptimal.)
"You might be curious how React knows which component useState corresponds to since we’re not passing anything like this back to React. We’ll answer this question and many others in the FAQ section." While I appreciate the functional usage of state, this type of magical behavior worries me a bit. Wasn't more straightforward semantics possible (even if the syntax wasn't similarly straightforward)?
Note they also say:
> We provide a linter plugin to enforce these rules automatically.
Makes me feel a little better.
React is starting to turn from a novel, but essentially simple idea into a clusterfuck mess.
Care to write a substantial contributing comment, or do you intend to keep this random complaint about the simplification of a common pattern in React as shallow as possible? Edit: No really, I'd like to hear why you think this would make React a "clusterfuck mess" rather than... simpler.
React is starting to turn from a novel, but essentially simple idea into a clusterfuck mess.
React is starting to turn from a novel, but essentially simple idea into a clusterfuck mess.