---
title: "Navdeep Singh (@navdeep) | Hashnode"
description: "Full Stack Developer - JavaScript. Read the latest articles by Navdeep Singh on Hashnode."
url: "https://hashnode.com/@navdeep"
---

@navdeep

# Navdeep Singh

@navdeep · Amritsar, India · Joined February 2016

Full Stack Developer - JavaScript

### [Search smart in VSCode using regex](https://nsblog.hashnode.dev/search-smart-in-vscode-using-regex?utm_source=hashnode&utm_medium=feed)

I was in the middle of writing a unit test case for some service built-in JavaScript using Jest. We need to mock data instead of actually having a connection using a database instance. In particular model response json data, I need to search for a pa...

1 min read · [nsblog.hashnode.dev](https://nsblog.hashnode.dev/search-smart-in-vscode-using-regex?utm_source=hashnode&utm_medium=feed)

[Nov 6, 2023](https://hashnode.com/posts/search-smart-in-vscode-using-regex/654882fcaa37d1b1aecc9fbd)

### [TIL #4: Why React Component re-renders in Strict mode](https://nsblog.hashnode.dev/til-4-why-react-component-re-renders-in-strict-mode?utm_source=hashnode&utm_medium=feed)

Today, while doing my day-to-day tasks, I come to observe that my API call in useEffect runs twice, I knew that it was re-rendering because of the local state changes inside the component, but it was not the case, in the first place the useEffect was...

1 min read · [nsblog.hashnode.dev](https://nsblog.hashnode.dev/til-4-why-react-component-re-renders-in-strict-mode?utm_source=hashnode&utm_medium=feed)

[1](https://hashnode.com/posts/til-4-why-react-component-re-renders-in-strict-mode/64abb2fa33419f267565a2e1) [Jul 10, 2023](https://hashnode.com/posts/til-4-why-react-component-re-renders-in-strict-mode/64abb2fa33419f267565a2e1)

### [What is Immutability in React?](https://nsblog.hashnode.dev/what-is-immutability-in-react?utm_source=hashnode&utm_medium=feed)

Objects are mutable in nature, but while working in React we need to create a copy of the object so that comparison can be done.

3 min read · [nsblog.hashnode.dev](https://nsblog.hashnode.dev/what-is-immutability-in-react?utm_source=hashnode&utm_medium=feed)

[3](https://hashnode.com/posts/what-is-immutability-in-react/61f8d8e4f6fc410f642301ca) [Feb 1, 2022](https://hashnode.com/posts/what-is-immutability-in-react/61f8d8e4f6fc410f642301ca)

### [TIL #3: Early Returns/Guard Clauses in JavaScript (and React)](https://nsblog.hashnode.dev/til-3-early-returnsguard-clauses-in-javascript-and-react?utm_source=hashnode&utm_medium=feed)

Early Return is a pattern that suggests we avoid nested if-else statements by checking the preconditions and return or throw as early as possible. Usually,

1 min read · [nsblog.hashnode.dev](https://nsblog.hashnode.dev/til-3-early-returnsguard-clauses-in-javascript-and-react?utm_source=hashnode&utm_medium=feed)

[6](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b) [Dec 14, 2021](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b)

### [TIL #2: How to Conditionally Add Props to a React Component?](https://nsblog.hashnode.dev/til-2-how-to-conditionally-add-props-to-a-react-component?utm_source=hashnode&utm_medium=feed)

Sometimes we need to avoid passing the entire prop key based on some condition, the conditional spreading here to rescue.

1 min read · [nsblog.hashnode.dev](https://nsblog.hashnode.dev/til-2-how-to-conditionally-add-props-to-a-react-component?utm_source=hashnode&utm_medium=feed)

[1](https://hashnode.com/posts/til-2-how-to-conditionally-add-props-to-a-react-component/61b1c2fd1907c16be2edfda4) [Dec 9, 2021](https://hashnode.com/posts/til-2-how-to-conditionally-add-props-to-a-react-component/61b1c2fd1907c16be2edfda4)
