Pull to refresh
46.53

ReactJS *

JavaScript library for interfaces creation

Show first
Period
Level of difficulty

The new code as the side effect

Level of difficultyMedium
Reading time4 min
Views744

The new code as the side effect

If we use the reducer function for form data handling It has an infinite list of returned values, which expands when the next development iteration updates the interface defining the form and implements a new field. So the reducer pattern is procedure code, not a functional

Read more
Total votes 1: ↑2 and ↓-1+3
Comments0

React Global State Management: A Brief History and a Quick Guide

Level of difficultyEasy
Reading time9 min
Views1.1K

If you’re a React developer, you know how important state management is. State is the data that powers your UI, making it interactive and dynamic. But managing state in React can be tricky, especially when you have to share it across multiple components or deal with complex and asynchronous logic.

That’s why over the years, React developers have come up with various solutions for state management, each with its own advantages and disadvantages. In this article, we’ll take a look at some of the most popular ones and how they evolved. We’ll also review some of the current state-management libraries and how to choose the best one for your app.

Read more
Total votes 3: ↑3 and ↓0+3
Comments0

React Custom Hook: useDebounce

Level of difficultyMedium
Reading time2 min
Views2.2K

This custom hook is particularly beneficial in scenarios where you need to handle user input, such as search bars or form fields, where you want to delay the execution of an action until the user has finished typing or interacting. It's also useful for optimizing network requests, ensuring that requests are sent only after the user has stopped typing or selecting options.

Read more
Total votes 5: ↑4 and ↓1+3
Comments0

Gatsby and its Greatness

Level of difficultyEasy
Reading time6 min
Views375

In the internet’s early days, blogging was straightforward. A server with PHP and MySQL allowed you to share your thoughts globally. Even FTP access with an index.html file sufficed.

However, as the web evolved, so did blogging requirements. Non-programmers needed user-friendly web interfaces, faster loading times, and seamless daily publishing. Platforms like Reddit, WordPress, and Tumblr emerged, but they faced a common issue: website ownership.

Read more
Total votes 2: ↑2 and ↓0+2
Comments0

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

Level of difficultyMedium
Reading time30 min
Views5.7K

Hello, dear users of the IT world!

In the era of active development of web technologies and interactive applications, 3D-graphics is becoming more and more relevant and in demand. But how to create a 3D application without losing the advantages of web development? In this article, we will look at how to combine the power of Three.js with the flexibility of React to create your own game right in the browser.

This article will introduce you to the React Three Fiber library and teach you how to create interactive 3D games.

Read more
Total votes 4: ↑3 and ↓1+2
Comments0

React Custom Hook: useScript

Level of difficultyMedium
Reading time2 min
Views2.5K

useScript can be used in various scenarios. For instance, you can load external libraries like jQuery, enabling you to harness its powerful functionalities without adding bulk to your bundle. Additionally, you can load analytics scripts, social media widgets, or any other script necessary for your application's dynamic behavior.

Read more
Total votes 4: ↑3 and ↓1+2
Comments1

React Custom Hook: useDebugInformation

Level of difficultyMedium
Reading time3 min
Views2.4K

The useDebugInformation hook can be applied in various scenarios. For instance, imagine you're working on a complex form component where certain props trigger updates or affect rendering. By utilizing useDebugInformation, you can easily monitor how these props impact your component's performance and whether unnecessary re-renders are occurring. Additionally, the hook can be invaluable when investigating why a specific component is not updating as expected or when fine-tuning optimizations in a performance-critical application.

Read more
Total votes 4: ↑3 and ↓1+2
Comments0

React Custom Hook: useDarkMode

Level of difficultyMedium
Reading time4 min
Views2.6K

One of the main advantages of "useDarkMode" is its simplicity. With just a few lines of code, you can enable dark mode in your React application. By invoking this hook, you'll receive the current dark mode state and a function to toggle it.

The "useDarkMode" hook dynamically updates the HTML body class to apply the "dark-mode" styling whenever dark mode is enabled. This approach ensures consistency across all components without the need for manual class manipulation.

Read more
Total votes 6: ↑4 and ↓2+2
Comments0

React Custom Hook: useStorage

Level of difficultyMedium
Reading time3 min
Views2.1K

One of the key advantages of this custom hook is its simplicity. You can use it to store any type of data, such as strings, numbers, or even complex objects, with just a few lines of code. Additionally, useStorage handles the serialization and deserialization of data for you, so you don't have to worry about converting values to and from JSON.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: useStateWithValidation

Level of difficultyMedium
Reading time2 min
Views1.4K

One of the key advantages of this custom hook is its flexibility. You can pass any validation function that suits your specific requirements. Whether it's checking the length of a string, ensuring a numeric value falls within a certain range, or performing more complex validations, useStateWithValidation has got you covered.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: useRenderCount

Level of difficultyMedium
Reading time2 min
Views1.3K

One of the major advantages of using useRenderCount is its simplicity. By abstracting the logic into a reusable hook, you can easily integrate it into any component without cluttering your codebase. Additionally, it provides a clear and concise way to monitor render behavior, which can be crucial for performance optimization and debugging.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: usePrevious

Level of difficultyMedium
Reading time2 min
Views4.5K

This custom hook can be a game-changer in various scenarios. For instance, you can utilize usePrevious to compare and visualize changes in data, track state transitions, or implement undo/redo functionality. Additionally, it can be valuable in form handling, animations, and any situation where having access to the previous value is crucial for your application's logic.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: useOnScreen

Level of difficultyMedium
Reading time2 min
Views2.9K

One of the key advantages of useOnScreen is its simplicity. With just a few lines of code, you can detect if an element is visible and respond accordingly. This can be immensely useful in scenarios where you want to trigger animations, lazy load images, or load additional content as the user scrolls.

Read more
Total votes 3: ↑2 and ↓1+1
Comments2

React Custom Hook: useMediaQuery

Level of difficultyMedium
Reading time2 min
Views2.6K

One of the key advantages of this custom hook is its simplicity and reusability. With just a few lines of code, you can effortlessly implement responsive behavior throughout your application. Whether you need to conditionally render components, apply specific styles, or trigger different functionality based on screen size, useMediaQuery has got you covered.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: useLongPress

Level of difficultyMedium
Reading time2 min
Views1.4K

One of the key advantages of useLongPress is its simplicity. By utilizing this hook, developers can easily define a long-press action on any element in their React application. With just a few lines of code, the hook takes care of handling the intricacies of tracking the long-press duration and triggering the associated callback function.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

React Custom Hook: useGeolocation

Level of difficultyMedium
Reading time2 min
Views2.3K

One of the key advantages of useGeolocation is its simplicity. By encapsulating the complex logic required for geolocation access and handling, this hook provides a clean and reusable solution. The hook automatically handles the loading state, updating it when geolocation data is being fetched, and sets the error state if any issues arise during the process.

Read more
Total votes 3: ↑2 and ↓1+1
Comments0

Supercharge Your React Projects with Custom Hooks

Level of difficultyMedium
Reading time42 min
Views8.4K

In this article, we dive into the world of custom React hooks and explore the incredible potential they hold for supercharging your work projects. With over 20 carefully crafted hooks at your disposal, I personally utilize these hooks in my own work projects, and now I'm excited to share them with you. From enhancing functionality to streamlining workflows, these custom hooks are designed to empower developers and deliver user-friendly experiences. Join us on this journey as we unleash the power of these 20+ hooks and unlock new levels of productivity and innovation in your React projects.

Read more
Total votes 1: ↑1 and ↓0+1
Comments2

How did I increase the website performance score from 35 to 100 for both mobile and desktop?

Level of difficultyEasy
Reading time5 min
Views1.6K

Not long ago, I started my personal blog. Instead of opting for the traditional route of using the popular WordPress CMS for blogs, I decided to embrace new technologies. My choice landed on Next.js and a NoSQL-type database.

Read more
Total votes 1: ↑1 and ↓0+1
Comments0

Authors' contribution