Why hooks are the best thing to happen to React

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • react-universal-hooks

    :tada: React Universal Hooks : just use****** everywhere (Functional or Class Component). Support React DevTools!

  • I don’t really understand the authors reasoning either. Classes in JavaScript are just sugar around functional closures.

    In fact, you can use hooks inside of React component subclasses with a little fiddling [1].

    The fact that the official react doesn’t support it is basically a design decision. It’s not impossible, but they just want to draw a clear line in the sand about how they think React code should be written.

    1. https://www.npmjs.com/package/react-universal-hooks

  • React

    The library for web and native user interfaces.

  • >because under the hood the React runtime is storing all the hooks you call in an array and firing them off by iterating through the array.

    I must correct this. Pay attention to this function [0]

    It's just a plain linked list and nothing is being fired off by iterating through the linked list. When you call a hook react either creates a new node in the linked list or it pops the current head off the linked list so that the second hook will get the second element, the third hook the third element and so on.

    The hooks are fired off by calling them. React isn't calling them again. Each render simply calls your component function and your function calls the hooks which runs a reducer [1] on the internal queue of the hook to compute the latest state. The second return value is just pushing elements into the internal hook queue.

    [0] https://github.com/facebook/react/blob/e07039bb61e3d006ad552...

    [1] https://github.com/facebook/react/blob/e07039bb61e3d006ad552...

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Gradual React-Router-Dom Upgrades (complex case)

    5 projects | dev.to | 10 Jan 2023
  • Installing React 18

    2 projects | /r/webdev | 15 May 2023
  • Very ambivalent to nextjs coming from Django

    2 projects | /r/nextjs | 21 Apr 2023
  • My 5 favourite updates from the new React documentation

    4 projects | dev.to | 31 Mar 2023
  • Everything You Need to Know About the Updated React Docs

    4 projects | dev.to | 17 Mar 2023