Fireship · @fireship

React for the Haters in 100 Seconds

Uploaded April 22, 2022 · Length 2:34

React for the Haters in 100 Seconds

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.

  1. 0:00

    react.js a half-baked functional ui

  2. 0:02

    library created at facebook that's used

  3. 0:04

    by millions of developers because it has

  4. 0:06

    a cool name and logo it was invented by

  5. 0:08

    mark zuckerberg in 2013. and that was a

  6. 0:10

    big mistake

  7. 0:12

    and it was my mistake and i'm sorry

  8. 0:14

    react is simple it's just javascript bro

  9. 0:16

    and that's why it gives you dozens of

  10. 0:17

    weird ways to solve the same problems

  11. 0:19

    like functional and class-based

  12. 0:20

    components hooks forward ref higher

  13. 0:22

    order components mix-ins render props

  14. 0:24

    suspense and so on it's credited as the

  15. 0:26

    first declarative ui library even though

  16. 0:28

    it took most of those ideas from

  17. 0:30

    angularjs its killer feature though is

  18. 0:32

    the fact that you can write pure

  19. 0:33

    functional code that is until you want

  20. 0:35

    to do anything useful in which case

  21. 0:36

    you'll need to write imper functions

  22. 0:38

    with state and effects the beauty of

  23. 0:39

    this approach is that it makes simple

  24. 0:41

    things like reactive state much more

  25. 0:42

    complicated than they need to be and

  26. 0:44

    that's what makes us feel like real

  27. 0:45

    developers use effect is especially fun

  28. 0:47

    and was originally going to be called

  29. 0:49

    use foot gun because it's a great way to

  30. 0:50

    introduce infinite loops performance

  31. 0:52

    issues and bugs that you'll never be

  32. 0:54

    able to figure out not to worry though

  33. 0:55

    react is always evolving with

  34. 0:57

    revolutionary new features to monkey

  35. 0:58

    patch all the weirdness nobody saw

  36. 1:00

    coming on the previous release now even

  37. 1:02

    though it has an extremely high learning

  38. 1:03

    curve react is a library and not a

  39. 1:05

    framework and that means to build

  40. 1:06

    something cool you'll need to find and

  41. 1:08

    install hundreds of different packages

  42. 1:09

    most of which were built by teenagers

  43. 1:11

    who stopped maintaining them years ago

  44. 1:12

    when they went off to college to learn a

  45. 1:14

    real language like c to get started

  46. 1:16

    create a new react app then open up

  47. 1:17

    google to enter the gates of tutorial

  48. 1:19

    hell notice how we start in strict mode

  49. 1:21

    that's used to hide baggage from

  50. 1:23

    previous versions of the framework i

  51. 1:24

    mean library now in the code we pretend

  52. 1:26

    we're doing functional programming by

  53. 1:28

    writing our components as functions

  54. 1:29

    classes are also possible but they are

  55. 1:31

    literally the double instead we use

  56. 1:33

    these hooks everywhere that do the same

  57. 1:35

    classes do in a more magical

  58. 1:37

    hipstery way templating is handled in

  59. 1:39

    jsx it's a non-standard way to write

  60. 1:41

    html which allows you to represent the

  61. 1:43

    ui entirely in non-portable callback

  62. 1:45

    hell now we can all agree to hate css

  63. 1:48

    but react will make you hate it even

  64. 1:49

    more when you try to style something on

  65. 1:51

    your own luckily there are hundreds of

  66. 1:52

    css and js libraries working on this

  67. 1:54

    problem as we speak the extra complexity

  68. 1:56

    is worth it though because react is

  69. 1:58

    blazingly fast assuming you implemented