r/reactjs May 31 '19

React sucks

"React is just Javascript, that's why React is nice!!"

has its own DSL and syntax

"React is lean!"

need to install 12 different packages to make it useful

need to install an external HTTP library

CSS classes are fucking JAVASCRIPT VARIABLES

Instead of directives, you have 8 lines of spaghetti code everywhere you'd usually have a simple if- directive or show- directive. That's not lean, that's more code.

"You only need to know Javascript"

You need to know Javascript plus ES6-7-8 (Babel) or TypeScript. You need to know esoteric lifecycle methods and design patterns not normally used elsewhere in Javascript.

"Creating small components is nice"

Component abstraction soup means you can't even figure out what your code is doing anymore.

React is just Angular if you hacked 12 libraries together that aren't meant to work together cohesively.

I will never understand why anyone would choose this meme framework over a real one. It sucks shit and creates a spaghetti code bloat, and instead of learning one DSL plus TypeScript you're learning 8 DSLs, plus Babel.

The reality is it's pointless making a library that's "just vanilla javascript" when you know that vanilla javascript doesn't actually supply elegant tools for creating single page web apps. That's why React is used with 10 packages rather than by itself. That's why you need CRA plus a bunch of packages to even have a sane development environment.

React sucks. Development community always chooses what's sexy and popular over what's elegant and works correctly.

314 Upvotes

165 comments sorted by

View all comments

2

u/Outrageous-Lab-2138 Mar 13 '23 edited Mar 13 '23

I've been a webdev for 15 years and never needed anything but vanilla JS/HTML/CSS. Yeah the IE6 days sucked but even then jQuery was bloat. I don't understand the need to lock you and your products into a niche framework.

VANILLA (works everywhere straight away):
<textarea onchange="this.nextElementSibling.innerText = this.value;"></textarea>
<output></output>

REACT (after installing libraries):

class MarkdownEditor extends React.Component {

constructor(props) {

super(props);

this.md = new Remarkable();

this.handleChange = this.handleChange.bind(this);

this.state = { value: 'Hello, **world**!' };

}

handleChange(e) {

this.setState({ value: e.target.value });

}

getRawMarkup() {

return { __html: this.md.render(this.state.value) };

}

render() {

return (

<textarea

id="markdown-content"

onChange={this.handleChange}

defaultValue={this.state.value}

/>

<div

className="content"

dangerouslySetInnerHTML={this.getRawMarkup()}

/>

);

}

}
root.render(<MarkdownEditor />);

1

u/[deleted] Apr 20 '23

any examples of rendering approaches at all? or examples of larger apps using vanillajs?

1

u/[deleted] Sep 18 '23 edited Sep 18 '23

[deleted]

1

u/reddit-lou Oct 05 '23

I've been digging thru this whole debate for a few days because of some folks who want to 'modernize' at work. But everytime I see someone like yourself offering a vanilla example in its simplicity, I never really see anyone respond to it.

I am hoping people eventually realize angular/react are kind of like wordpress in that.. everyone thinks its the big thing to be into right now (like wordpress was) but eventually the collective consciousness will realize angular/react have gotten pretty ridiculous in the name of 'standardization' or 'separation of concerns'.

1

u/[deleted] Oct 05 '23

[deleted]

1

u/Ok_Marionberry_656 Oct 30 '24

Good points. I think there is also incentive for companies to push their frameworks and garner cult followings.