Quantcast
Channel: reactjs – Wisdom Geek
Browsing latest articles
Browse All 19 View Live

Image may be NSFW.
Clik here to view.

Using React.memo() in React 16.6

React 16.6 was released a couple of days and and it brings a couple of new features. One of these is React.lazy() which is something that requires a separate post in itself along with React Suspense....

View Article



Image may be NSFW.
Clik here to view.

Using Emotion js in a react project

CSS in JS is a fairly controversial topic depending on who you talk to. What it gives you is the ability to do is write all your styling in javascript instead of creating a separate CSS file. I really...

View Article

Image may be NSFW.
Clik here to view.

React Hooks and Local Storage: Let’s build a ToDo app

React hooks have been around for quite some time. They have been widely adopted by the React community since then and have started becoming the defacto for newer React applications. A react hook allows...

View Article

Image may be NSFW.
Clik here to view.

Understanding the useReducer hook in React

Building upon our React hooks introduction from our previous post on understanding React hooks (useState and useEffect), we will look at the useReducer hook in this post. useReducer hook can be an...

View Article

Image may be NSFW.
Clik here to view.

Learning context API and the useContext React hook

In this react hooks series, we have already explored the react hooks useState, useEffect, and useReducer. The next react hook we will look into is the useContext hook. As we saw while building our...

View Article


Image may be NSFW.
Clik here to view.

Detecting click outside component using React hooks

If you have tried developing your own dropdown, modal, or popover in React, you would have come across this. “How do I detect a click outside my react component so that I can close it?” Detecting click...

View Article

Image may be NSFW.
Clik here to view.

Provide callback to useState hook like setState

If you have been writing class components for a while, you might be familiar with the callback functionality that the setState function provides. setState allows a second parameter to be passed to it...

View Article

Image may be NSFW.
Clik here to view.

How to write your own custom React hooks

If you have been using react for a while, chances are you have come across the need to extract some logic into a reusable function. And with React hooks coming into the picture, doing this has become a...

View Article


Image may be NSFW.
Clik here to view.

Use redux-like middleware for useReducer in React

If you have used Redux before, you would be aware of the concept of middlewares. Now that useReducer has become a commonly used react hook, we might want to replicate the idea of middleware for the...

View Article


Image may be NSFW.
Clik here to view.

Understanding the useRef React hook

Continuing our React hooks series, we will learn about the useRef React hook in this blog post. The useRef React hook is useful in the following two situations: Before we see these advantages of the...

View Article

Image may be NSFW.
Clik here to view.

Using the useCallback React hook

The useCallback React hook is a useful hook that can help in optimizing the rendering performance of our functional React components. It is used to memoize functions which means it caches the return...

View Article

Image may be NSFW.
Clik here to view.

Avoiding race conditions and memory leaks in React useEffect

Let us take a look at an implementation of getting data from an API request and see if there is any possibility of race conditions happening in this component: JavaScript We have specified an empty...

View Article

Image may be NSFW.
Clik here to view.

Why does React state need a new object/array?

If you have been using React for a while, you are familiar with how state update works. There are a lot of internal optimizations that React makes for faster rendering. One of the implementation...

View Article


Image may be NSFW.
Clik here to view.

React fragments: What and Why

React fragments were a feature released in React 16.2. They have been around for a while now but have been a relatively lesser used feature. Let us explore the what and why the feature exists. React...

View Article

Image may be NSFW.
Clik here to view.

How to convert a React component to an image

Sometimes you want to give the users the ability to download a part of the web application as an image. In that case, you want a way to convert a React component to an image. And it can be...

View Article


Image may be NSFW.
Clik here to view.

Automatic batching in React 18 helps avoid re-rendering

Remember the earlier versions of React that used to batch multiple state updates inside event handlers such as click or change to avoid multiple re-renders? React 18 has added automatic batching for...

View Article

Image may be NSFW.
Clik here to view.

How to write comments in React (JSX)?

I was recently trying to comment out some logic inside my JSX to add context about what a potentially complex logic. I then realized that comments in JSX are weird. So, how to write comments in React...

View Article


Image may be NSFW.
Clik here to view.

Using Font Awesome with React

Font Awesome is a great resource to use various types of icons in your project including well-known social media icons and a lot more. It can be used with any front-end library. In this post, we are...

View Article

Image may be NSFW.
Clik here to view.

Why should we not use index as key in React Lists

When working with React, developers often come across the need to render lists of items efficiently. Every item in a list needs to have a key prop assigned to it. It is essential for enabling React to...

View Article
Browsing latest articles
Browse All 19 View Live


Latest Images