Remix.run Logo
socalgal2 2 hours ago

You could walk through the framework so you then understand it. There are several "let's create react from scratch" articles

https://pomb.us/build-your-own-react/

Certain frameworks were so useful they arguably caused an explosion the productivity. Rails seems like one. React might be too.

xp84 20 minutes ago | parent | next [-]

Thanks for this! I've mostly avoided getting too into React and its ilk, mainly because I hate how bloated the actual code generated by that kind of application tends to be. But also I am enjoying going through this. If I can complete it, I think I will be more informed about how React really works.

yellowapple an hour ago | parent | prev [-]

Thanks to that page letting me see how many dozens of lines of code React needs to do the equivalent of

    const element = document.createElement("h1");
    element.innerHTML = "Hello";
    element.setAttribute("title", "foo");
    const container = document.getElementById("root");
    container.appendChild(element);
I now have even less interest in ever touching a React codebase, and will henceforth consider the usage of React a code smell at best.
htnthrow11220 an hour ago | parent | next [-]

To be fair, if all you need is to add elements to a child you don’t need React.

Maybe nobody needs React, I’m not a fan. But a trivial stateless injection of DOM content is no argument at all.

Mogzol 20 minutes ago | parent | prev | next [-]

The "magic" of React though is in its name, it's reactive. If all you're doing is creating static elements that don't need to react to changes in state then yeah, React is overkill. But when you have complex state and need all your elements to update as that state changes, then the benefits of React (or similar frameworks) become more apparent. Of course it's all still possible in vanilla JS, but it starts to become a mess of event handlers and DOM updates and the React equivalent starts to look a lot more appealing.

madeofpalk an hour ago | parent | prev | next [-]

All of that is the JavaScript equivalent of

    <h1 title=foo>Hello</h1>
I have even less interest in touching any of your codebases!
yellowapple 13 minutes ago | parent [-]

Well I'd hesitate to touch any of my codebases, too, so that's fair :)

fragmede 26 minutes ago | parent | prev [-]

Given the verbosity of Java's hello world vs Python's, you'd walk away with the conclusion that Java should never be used for anything, but that would be a mistake.

ZeWaka 20 minutes ago | parent [-]

Clearly Java only belongs on things like credit cards and Minecraft /s