News for hackers. Stuff that matters.
Re:Select * from cloud by Scarbutt on Friday September 30, 2022 @01:23PM (#33037763)
React is implemented using OOP, which I think is great for libraries that are defining and defending boundaries.
Re:Select * from cloud by kortex on Friday September 30, 2022 @08:06PM (#33042330)
That's like saying the Glasgow Haskell Compiler is implemented in part with C, therefore Haskell is imperative.

The React "way" is very much leaning into pure immutable data that flows through components which react to changes. Components aren't objects in the OOP sense. You don't call methods on them to update their internal state.

Re:Select * from cloud by Scarbutt on Saturday October 01, 2022 @12:11AM (#33043798)
Never said React was imperative.
Re:Select * from cloud by continuational on Friday September 30, 2022 @02:51PM (#33039031)
Hooks is not really OOP. The original OOP interface was abandoned because it lead to a very complicated lifecycle that was hard to reason about.
Re:Select * from cloud by Scarbutt on Friday September 30, 2022 @03:16PM (#33039409)
I'm referring to the implementation of React, not its API.
Re:Select * from cloud by yamtaddle on Friday September 30, 2022 @05:47PM (#33041230)
Can confirm, unless it's changed radically since I last looked at it, yes, everydamnthing in React ends up as an object representing a component, and I don't just mean in the way that JS functions are technically also objects.
Re:Select * from cloud by pjmlp on Friday September 30, 2022 @03:04PM (#33039240)
Except the little detail that JavaScript is an OOP language in the linage of SELF, where even basic types have methods.
Re:Select * from cloud by mirekrusin on Friday September 30, 2022 @02:53PM (#33039072)
No, it's not.
Re:Select * from cloud by yamtaddle on Friday September 30, 2022 @05:51PM (#33041272)
It is, in large part, right down at what you might call the heart of the whole thing. Though I haven't read the React source code since a bit after Hooks were added so I guess maybe that's changed—though I doubt it.