Re:React as a UI Runtime
by quantummkv on Sunday February 03, 2019 @08:26AM
(#19069444)
> I think what I'm looking for is React to take some ownership and provide guidance out of the box for these core browser features under the React umbrella.
So we need React on Rails? An opinionated collection of libraries that work on top on the React Runtime. I personally find this idea compelling.
There are a few of these sorts of things already. I'm not really talking about opinionated frameworks (or collections of various github projects stuff into a big meta project). https://reactjs.org/community/starter-kits.html
What I'm talking about is something more akin to this statement: https://angular.io/guide/forms-overview "Handling user input with forms is the cornerstone of many common applications"
Re:React as a UI Runtime
by quantummkv on Sunday February 03, 2019 @10:17AM
(#19069986)
But isn't that something React wants to avoid? I remember reading somewhere that React does not want to recommend any approach to forms, routing, etc., but leave it to the user.
Re:React as a UI Runtime
by machiaweliczny on Sunday February 03, 2019 @11:53AM
(#19070634)
Vue is just like that. Actually from 3.0 it might be better than React.
Styling is handled out-of-the-box. Reactiveness will be glitch free with proxies and it will have TS support.
(Disclaimer: I use React right now)
Re:React as a UI Runtime
by danabramov on Sunday February 03, 2019 @09:29AM
(#19069701)
I mean, I don’t think it’s designed to “put an input on the page”. Tracking things like hover, dirty and pristine states, sync and async validation, etc, is an inherently complex problem.
If you just want to put an input on the page, that’s just three lines with React. (Especially with Hooks.)
Reading the documentation again, I just remembered this page:
https://reactjs.org/docs/forms.html
Makes my point (happily) moot. You're right. Sorry for the trouble.
However, part of that complexity is the fault of React. The choice of HOC vs. Component... two ways to do the same thing. There is also FastForm vs. Form. As we move on over time, now we have hooks being added as well. The mental complexity just to put a simple input on a page is overwhelming.
I think what I'm looking for is React to take some ownership and provide guidance out of the box for these core browser features under the React umbrella.