DEV Community

joedev090
joedev090

Posted on

The Hooks in React

Hi Coders!!!

The last week I posted in my Linkedin about the hooks in javascript and react in spanish.

https://www.linkedin.com/posts/joedev90_hooks-javascript-react-activity-7252763632265056257-4Whg

I decided to create a post in english and then a series of post to explain in more details about the most used hooks in react.

So Let's check!!

The hooks are functions in javascript to create/access to the state and lifecycles of react components.

The hooks must use which these two rules:

  • Must be called on the top level of the app.
  • Must call in functions or in other customized hooks of react.

The most common hooks in react:

  • useState
  • useEffect
  • useContext
  • useRef
  • useReducer
  • useLayoutEffect
  • useMemo
  • useCallback

Finally we also have the way to create our custom hooks

I will have a link to check in details each one, it is in official react documentation.

https://react.dev/reference/react/hooks

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more