Fireship · @fireship
React for the Haters in 100 Seconds
Uploaded April 22, 2022 · Length 2:34
Summary
A sarcastic rant about React's complexity and flaws, but also its popularity and influence in web development.
- react
- javascript
- web development
- ui library
- complexity
- popularity
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
react.js a half-baked functional ui
- 0:02
library created at facebook that's used
- 0:04
by millions of developers because it has
- 0:06
a cool name and logo it was invented by
- 0:08
mark zuckerberg in 2013. and that was a
- 0:10
big mistake
- 0:12
and it was my mistake and i'm sorry
- 0:14
react is simple it's just javascript bro
- 0:16
and that's why it gives you dozens of
- 0:17
weird ways to solve the same problems
- 0:19
like functional and class-based
- 0:20
components hooks forward ref higher
- 0:22
order components mix-ins render props
- 0:24
suspense and so on it's credited as the
- 0:26
first declarative ui library even though
- 0:28
it took most of those ideas from
- 0:30
angularjs its killer feature though is
- 0:32
the fact that you can write pure
- 0:33
functional code that is until you want
- 0:35
to do anything useful in which case
- 0:36
you'll need to write imper functions
- 0:38
with state and effects the beauty of
- 0:39
this approach is that it makes simple
- 0:41
things like reactive state much more
- 0:42
complicated than they need to be and
- 0:44
that's what makes us feel like real
- 0:45
developers use effect is especially fun
- 0:47
and was originally going to be called
- 0:49
use foot gun because it's a great way to
- 0:50
introduce infinite loops performance
- 0:52
issues and bugs that you'll never be
- 0:54
able to figure out not to worry though
- 0:55
react is always evolving with
- 0:57
revolutionary new features to monkey
- 0:58
patch all the weirdness nobody saw
- 1:00
coming on the previous release now even
- 1:02
though it has an extremely high learning
- 1:03
curve react is a library and not a
- 1:05
framework and that means to build
- 1:06
something cool you'll need to find and
- 1:08
install hundreds of different packages
- 1:09
most of which were built by teenagers
- 1:11
who stopped maintaining them years ago
- 1:12
when they went off to college to learn a
- 1:14
real language like c to get started
- 1:16
create a new react app then open up
- 1:17
google to enter the gates of tutorial
- 1:19
hell notice how we start in strict mode
- 1:21
that's used to hide baggage from
- 1:23
previous versions of the framework i
- 1:24
mean library now in the code we pretend
- 1:26
we're doing functional programming by
- 1:28
writing our components as functions
- 1:29
classes are also possible but they are
- 1:31
literally the double instead we use
- 1:33
these hooks everywhere that do the same
- 1:35
classes do in a more magical
- 1:37
hipstery way templating is handled in
- 1:39
jsx it's a non-standard way to write
- 1:41
html which allows you to represent the
- 1:43
ui entirely in non-portable callback
- 1:45
hell now we can all agree to hate css
- 1:48
but react will make you hate it even
- 1:49
more when you try to style something on
- 1:51
your own luckily there are hundreds of
- 1:52
css and js libraries working on this
- 1:54
problem as we speak the extra complexity
- 1:56
is worth it though because react is
- 1:58
blazingly fast assuming you implemented


