3 ms·
React is not only introducing layers and layers of abstractions/ concepts that are hard to grasp for a newcomer, they are also reclaiming well-established terms
by yewenjie 5y ago
React is not only introducing layers and layers of abstractions/ concepts that are hard to grasp for a newcomer, they are also reclaiming well-established terms.
> A transition is a new concept in React to distinguish between urgent and non-urgent updates.
> Urgent updates reflect direct interaction, like typing, clicking, pressing, and so on.
> Transition updates transition the UI from one view to another.
- vosper 5y agoI’m pretty sure they’re not claiming to have invented transitions. They maybe should have said “a new concept to React” rather than “a new concept in React”.
- danabramov 5y ago“State transition” is a well-established concept, which applies here. We’re also planning to eventually integrate this feature with animations, which would match the other meaning of “transition”. This is why we settled on this term. We get similarly criticized when we come up with our own names for features, so it’s a tricky balance.
- deleted 5y ago[deleted]
- nop_slide 5y agoI'm also confused by the `useTransition` idea, to be honest I don't exactly know when or where I would use it after reading about it. Sounds like a specific optimization tactic.
- danabramov 5y agoOver time, we expect that in most cases you wouldn’t use it directly. Instead, a router might use it for route changes, for example, automatically marking them as transitions. This would make it possible for the user to click a link in the middle of rendering, and immediately handle it instead of being blocked until the render completes.
- nop_slide 5y agoI see, that makes sense. Thanks for the explanation!
- thex10 5y agoAnd, more irksome to me, they don't keep their docs up to date. The beta React docs _still_ don't even document the useEffect hook.
- danabramov 5y agoThe beta React docs are beta because they're incomplete. The stable docs have the entire API documented.
- haolez 5y agoIn this specific context, can Preact be considered a more "reasonable" React offering? Or does it follow each and every feature of React?
- nicoburns 5y agoIt's definitely a much simpler react-like library. You don't get the React ecosystem though. If you're looking to step out beyond React, inferno is also worth considering. It focuses on performance rather than bundle size (it's smaller than React, but bigger than Preact).
- rschristian 5y ago> You don't get the React ecosystem though. Well this is an odd thing to say, as there's a whole dedicated compatibility layer. That's not to say it's 100%; relying on specifics of synthetic events, such as bubbling through portals, for example, won't work but it's a drop-in replacement for many users. Take a peek at https://preactjs.com/guide/v10/switching-to-preact/ https://preactjs.com/guide/v10/switching-to-preact/
- pandesal 5y agoI don't get how "layers and layers of abstraction/concepts that are hard to grasp for a newcomer" is your critique here? The literal entirety of tech is layers and layers of abstraction. Also, just because the improvements or new concepts are going to be difficult for newcomers to grasp doesn't mean they are objectively bad. The fact that things are going to be difficult for newcomers should not be an impeding factor on whether or not to build upon existing features. There are ways for newcomers to build up their way to eventually learn the advance concepts. Newcomers are not forced to go from 0-100 on day 1