---
title: "Rajat Gupta (@therajatg) | Hashnode"
description: "I write about CSS, JavaScript, React and everything in between. Read the latest articles by Rajat Gupta on Hashnode."
url: "https://hashnode.com/@therajatg"
---

@therajatg

# Rajat Gupta

@therajatg · Rajasthan, India · Joined January 2022

I write about CSS, JavaScript, React and everything in between.

### [How to setup different database for development and testing in NodeJS](https://rajatgupta.net/how-to-setup-different-database-for-development-and-testing-in-nodejs?utm_source=hashnode&utm_medium=feed)

Obviously we do not want to mess up our development and test data and hence want to setup a different database for both the purposes.

2 min read · [rajatgupta.net](https://rajatgupta.net/how-to-setup-different-database-for-development-and-testing-in-nodejs?utm_source=hashnode&utm_medium=feed)

[May 29, 2024](https://hashnode.com/posts/how-to-setup-different-database-for-development-and-testing-in-nodejs/66571de6ba7a1673343cc02d)

### [React Router: Basics](https://rajatgupta.net/react-router-basics?utm_source=hashnode&utm_medium=feed)

Let's get the party started. If you have not used react-router before most probably you are using server-side routing. If you don't know what's server side routing, see the below example: As you could see there is a splash of the white screen when w...

5 min read · [rajatgupta.net](https://rajatgupta.net/react-router-basics?utm_source=hashnode&utm_medium=feed)

[1](https://hashnode.com/posts/react-router-basics/623ab622343ee96c27556b72) [Mar 23, 2022](https://hashnode.com/posts/react-router-basics/623ab622343ee96c27556b72)

### [promises and async-await in JavaScript](https://rajatgupta.net/promises-and-async-await-in-javascript?utm_source=hashnode&utm_medium=feed)

Let's see what MDN has to say: A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. This lets asynchronous meth...

7 min read · [rajatgupta.net](https://rajatgupta.net/promises-and-async-await-in-javascript?utm_source=hashnode&utm_medium=feed)

[Mar 16, 2022](https://hashnode.com/posts/promises-and-async-await-in-javascript/62322d3bfaf37c06759281a3)

### [useReducer in react: Everything you need to know](https://rajatgupta.net/usereducer-in-react-everything-you-need-to-know?utm_source=hashnode&utm_medium=feed)

prerequisites: Grasp of reduce method in JavaScript and useState in react For reduce method, I recommend you to read my blog here: https://rajatgupta.net/reduce-method-in-javascript Ok, Let's get started. The useReducer Hook is similar to the useS...

8 min read · [rajatgupta.net](https://rajatgupta.net/usereducer-in-react-everything-you-need-to-know?utm_source=hashnode&utm_medium=feed)

[4](https://hashnode.com/posts/usereducer-in-react-everything-you-need-to-know/622e4199197586d5f925c619) [Mar 13, 2022](https://hashnode.com/posts/usereducer-in-react-everything-you-need-to-know/622e4199197586d5f925c619)

### [useContext in react: everything you need to know](https://rajatgupta.net/usecontext-in-react-everything-you-need-to-know?utm_source=hashnode&utm_medium=feed)

only understand this: Using useContext is not necessary, we use it to avoid prop drilling. Here's how prop drilling works:Let's say the grandfather component has a certain state and the great-grandson component needs to use this state. Now, in order ...

9 min read · [rajatgupta.net](https://rajatgupta.net/usecontext-in-react-everything-you-need-to-know?utm_source=hashnode&utm_medium=feed)

[3](https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6) [Mar 11, 2022](https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6)
