Best of habrSeptember 2023

  1. 1
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useScript

    This article explores the useScript custom hook in React, which allows for asynchronous script loading and improves performance and user experience. It provides examples of how the hook can be used in different scenarios.

  2. 2
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useOnScreen

    The useOnScreen hook leverages the power of the Intersection Observer API. It can be immensely useful in scenarios where you want to trigger animations, lazy load images, or load additional content as the user scrolls. UseOnScreen will notify you when it enters or exits the viewport.

  3. 3
    Article
    Avatar of habrhabr·3y

    React Custom Hook: usePrevious

    "usePrevious" hook is one of the many carefully crafted hooks available in the collection of React custom hooks. The advantages of using usePrevious are remarkable. By using useRef, this hook efficiently stores the current and previous values, updating them whenever the value changes.

  4. 4
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useRenderCount

    The "useRenderCount" hook is one of the many carefully crafted hooks available in the collection of React custom hooks. The hook uses React's useEffect and useRef hooks to keep a count of renders. With each render, the count is incremented, providing you with real-time feedback on the component's render frequency.