Best of habrOctober 2023

  1. 1
    Article
    Avatar of habrhabr·3y

    React + Three.js. Creating your own 3D shooter. Part 1

    This article explores the integration and features of React Three Fiber, a library that combines React and Three.js for creating 3D graphics on the web. It discusses the advantages of using React Three Fiber, the relevance of web game development, and performance aspects to consider. The article provides a step-by-step guide on setting up the project, customizing the Canvas display, adding a floor surface, lighting, physics, camera movement, importing 3D models, enabling shadows, and adding animation. The next part of the article will cover further improvements to the game.

  2. 2
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useStorage

    Discover the potential of React custom hooks with a focus on the 'useStorage' hook. It provides convenient functions for storing and retrieving data in the browser's local or session storage. The hook handles serialization, deserialization, and automatic synchronization with the component's state. The remove function allows for easy deletion of stored values. Use the hook in various scenarios, such as persisting user preferences in a settings panel.

  3. 3
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useStateWithHistory

    Explore the benefits and use cases of the useStateWithHistory custom React hook which provides automatic history tracking, efficient memory usage, and time-travel functionality.

  4. 4
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useTimeout

    Learn about the useTimeout hook in React, which allows for easy setting, clearing, and resetting of timeouts within a component. The hook ensures that the callback function remains up to date and optimizes performance by memoizing certain functions. It can be used in various scenarios where timed actions are required.

  5. 5
    Article
    Avatar of habrhabr·3y

    React Custom Hook: useStateWithValidation

    Explore the useStateWithValidation custom React hook, which combines the useState and useCallback hooks to provide an elegant solution for managing state with validation.