Best of habrAugust 2023

  1. 1
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useArray

    "useArray" hook is one of the many carefully crafted hooks available in the collection of React custom hooks. The useArray hook uses the useState hook from React to manage the array state. The advantages of using this custom hook are twofold: it simplifies the management of array states and provides a cleaner and more readable code structure.

  2. 2
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useAsync

    The useAsync hook takes in a callback function that performs the asynchronous operation and an optional array of dependencies. It returns an object with three properties: loading, error, and value. The hook employs the useState and useEffect hooks to manage the loading state and invoke the memoized callback function when necessary.

  3. 3
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useDarkMode

    "UseDarkMode" Hook is one of the many carefully crafted hooks available in the collection of React custom hooks. It combines two other handy hooks and, to provide a seamless dark mode experience. It automatically detects the user's preferred color scheme and persists the dark mode state in the browser's local storage.

  4. 4
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useClickOutside

    The useClickOutside hook is designed to simplify the process of detecting clicks outside a specified component. It listens for click events on the document level, allowing you to trigger a callback function when a click occurs outside the provided component's reference. It works seamlessly with functional components using the useState and useRef hooks.

  5. 5
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useDebugInformation

    React Custom Hook: useDebugInformation is one of the many carefully crafted hooks available in the collection of React custom hooks. The hook tracks the number of renders, changed props, time since the last render, and the timestamp of the last rendering. UseDebugInformation can be applied in various scenarios.

  6. 6
    Article
    Avatar of habrhabr·3y

    Let's kill all frameworks at once

    The general trend of technology development is characterized by surges and declines, says John Sutter. Sutter: We are entering an era where framework and Electron technologies may be eclipsed by generative AI. He says.NET is becoming an open platform with all source code available on GitHub.NET.

  7. 7
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useCookie

    React Custom Hook: useCookie is one of the many carefully crafted hooks available in the collection of React custom hooks. UseCookie allows you to effortlessly handle cookies by providing a concise interface. In scenarios where you need to remove a cookie, the deleteCookie function comes to the rescue.