Rahul Bansal has Published 50 Articles

LocalStorage in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 01-Nov-2023 14:44:52

30K+ Views

In this article, we are going to see how to set and retrieve data in the localStorage memory of the user’s browser in a React application.LocalStorage is a web storage object to store the data on the user’s computer locally, which means the stored data is saved across browser sessions and ... Read More

RegEx in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 14-Sep-2023 02:10:28

28K+ Views

In this article, we are going to see how to handle the strings with RegEx handling in a React application.A RegEx or Regular Expression is a sequence of characters that forms a search pattern and is used to check if a string contains a specified search pattern or not. It ... Read More

How to set cookies in ReactJS?

Rahul Bansal

Rahul Bansal

Updated on 10-Sep-2023 08:24:17

30K+ Views

In this chapter, we are going to see how to set, remove and retrieve cookies in a React application.Cookies are the data stored in the form of key-value pairs that are used to store information about the user on their computer by the websites that the users browse and use ... Read More

Validate URL in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:15:50

2K+ Views

In this article, we are going to see how to validate a URL (Uniform Resource Locator) in a React application.To validate a URL, we are going to install a third-party package of ‘validator’ which is used to validate the URL. Example of a valid and an invalid URL are as ... Read More

Using onKeyPress event in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:15:29

3K+ Views

In this article, we are going to see how to access the keycode which the user has pressed in a React applicationTo detect the keycode or the key which the user has pressed from his keyboard then React has a predefined onKeyPress event for this. Although it is not fired for ... Read More

Suspense in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:15:05

890 Views

In this article, we will learn how to show a loader while the component is being lazily loaded.When the components are lazily loaded, it requires a fallback to be shown to indicate that the component is being loaded in the DOM.SyntaxExampleIn this example, we will build a Routing application that ... Read More

Strict Mode in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:12:27

605 Views

In this article, we are going to see how to highlight potential problems that we might have in a React Application.React.StrictMode is a helper functionality provided by React which allows us to write better React codes. It provides visual feedback in the form of warnings if we don’t follow the ... Read More

Sending Http Requests in ReactJS

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:08:51

840 Views

In this article, we are going to learn how to send and receive Http Responses in a React application.To send or receive data, we don’t need to use third-party packages, rather we can use the fetch() method which is now supported by all the modern browsers.Sending GET requesthttps://jsonplaceholder.typicode.com/todos/1Jsonplaceholder is a ... Read More

ReactJS – useState hook

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:02:51

318 Views

In this article, we are going to see how to use the useState hook in a functional component.State is the place where the data comes from. We should always try to make our state as simple as possible. With React 16.8, hooks are released which allow us to handle the ... Read More

ReactJS – useRef hook

Rahul Bansal

Rahul Bansal

Updated on 19-Mar-2021 11:00:49

464 Views

In this article, we are going to see how to create a reference to any DOM element in a functional component.This hook is used to access any DOM element in a component and it returns a mutable ref object which will be persisted as long as the component is placed ... Read More

Advertisements