React.js Lecture Summary

Jul 17, 2024

Overview of React.js

General Info

  • JavaScript library for building UIs
  • Created at Facebook, credited to Mark Zuckerberg
  • Launched in 2013
  • Extremely popular, widely used by developers

Pros

  • Pure functional code for building UIs
  • Declarative style, similar to AngularJS

Cons

  • High learning curve
  • Need to manage state and effects imperatively, complicating simple things
  • Requires many additional packages, often poorly maintained

Features

  • Functional and class-based components
  • Hooks (e.g., useEffect)
  • Forward refs
  • Higher-order components
  • Mix-ins
  • Render props
  • Suspense

JSX

  • Templating handled in JSX, a non-standard way of writing HTML
  • Encourages use of callback functions

Strict Mode

  • Helps mitigate issues from previous versions

Styling

  • Difficult to handle CSS
  • Many CSS-in-JS libraries available

Performance

  • Can be fast if optimized properly

Popularity

  • Most popular UI library, influences front-end development heavily

Final Thoughts

  • React has flaws but is influential and respected in the web development community.