In reality, things are not the way as it appears to us. Our brain through conditioning sees the world as made up of independent things. In reality, all things are interdependent on one another and cannot exist alone. For eg, we cannot exist without food and air.

Just like a person in the mirror is empty of eyes, ears, etc, we are devoid of the properties that we think are inherent to us.…

Read More

Note: I tried testing ChatGPT to produce more complex code! But this one failed miserably. Read on.


Rendering a Sankey diagram in React using SVG can be a complex task as it involves creating paths and managing node positions. There are libraries available that simplify the process, such as react-sankey or d3-sankey. However, if you prefer to implement it manually, here’s an example code snippet to get you started:

import React from 'react';

const SankeyDiagram = ({ data, width, height }) ={
  const { nodes, links } = data;

  const nodeWidth = 20;
  const nodePadding = 8;

  const maxLinkValue = Math.max(...links.map(link
Read More

To render a pie chart in React using SVG, you can create a reusable component that takes data as input and generates the SVG elements accordingly. Here’s an example code snippet that demonstrates how to do this:

import React from 'react';

const PieChart = ({ data, width, height }) ={
  const total = data.reduce((sum, { value }) =sum + value, 0);
  const center = width / 2;
  const radius = Math.min(width,
Read More

To render a line chart in React using SVG, you can create a reusable component that takes data as input and generates the SVG elements accordingly. Here’s an example code snippet that demonstrates how to do this:

import React from 'react';

const LineChart = ({ data, width, height, lineColor }) ={
  const maxValue = Math.max(...data);
  const xScale = width / (data.length
Read More

To render a bar chart in React using SVG, you can create a reusable component that takes data as input and generates the SVG elements accordingly. Here’s an example code snippet that demonstrates how to do this:

import React from 'react';

const BarChart = ({ data, width, height, barColor }) ={
  const barWidth = width / data.length;
  const maxValue = Math.max(...data);
Read More

Setting up unit testing in a React app involves several steps. Here’s a general guide to help you get started:

Step 1: Install the necessary dependencies

You’ll need to install the testing libraries and tools required for unit testing in React. The most common ones are Jest and React Testing Library.

npm install --save-dev jest @testing-library/react

Step 2: Create the test files

Create a folder called __tests__ in your source code directory (usually the same level as the src folder).…

Read More

To use Redux in a React app with Redux Toolkit, you can follow these steps:

  1. Install Redux Toolkit: Start by installing Redux Toolkit using npm or yarn. Open your terminal and run the following command:
npm install @reduxjs/toolkit

2. Set up your Redux store: Create a file called store.js (or any other name you prefer) in your project’s directory. In this file, import the necessary Redux Toolkit functions and create your Redux store.…

Read More

Progressive web apps (PWA) allow users to add the web app to the home screen. The goal is to make a web app look like a native app. So, a PWA is responsive and adjusts well to appear good in any mobile device. Even when the device is offline, it should render some content. Optionally, it should respond to push notifications, sync the app content in the background and have the capability to access camera, location, etc.…

Read More