There is a way by using the Profiler. It’s extremely easy to use and super lightweight. Profiler API All you need to do to use it is to import it from React and wrap the part of the JSX tree that you’d like to have analysed. Let’s write a simple counter application and analys...
In this tutorial, Chidi Orji will show you how to build a React drag-and-drop component for file and image uploads. In the process, we’ll learn about the HTML drag-and-drop API. We will also learn how to use the useReducer hook for managing state in a React functional component. The...
Discover how to effectively use React Context API in both functional and class components. Context provides a way to share values like these between components without having to explicitly pass a prop through every level of the tree.
If you’re not familiar with React Contexts, make sure to skim through React Context API: Using React Context with APIs effectively. Step 3: Access it within lower React Components Inside any component lower in the Component tree than your Provider, use the useSelector Hook to access state ...
In this guide, we will explore how to use the Fetch API with React to fetch data from a remote server and display it in a React component.
How to use map() in React applications By Dawid Budaszewski javascript Map is one of the most popular and widely used functions when working with React. It has two prominent use cases. It’s quite similar to how the filter() works. The first one is to modify the state of the ...
While doing work in frontend development, you may have come across useMemo. For those unfamiliar with it, we will explain how to use useMemo in React and also the most important/prominent use cases. What is useMemo? useMemo is a great built-in hook that can help with the performance of ...
In this tutorial, we will go over the concept of forwarding refs in React and understand how it helps us manage interactions with the DOM. For a more engaging experience, we’ll cover how to create refs, attach created refs to DOM elements and classes, use the forwardRef method, and more...
The useMemo() Hook is a built-in React Hook that allows you to memorize the result of a computation. It’s useful when you have a costly function or calculation that you only want to run when certain dependencies change. To use the‘useMemo()’Hook, follow these steps: ...
Learn, how to use the useLocation hook in react-router. reactgo.com recommended courseReact - The Complete Guide (incl Hooks, React Router, Redux) If your are new to hooks checkout my react hooks introduction tutorial. useLocation hook The useLocation hook helps us to access the location obje...