How to Build a React Multi-Select Component

Build a React Multi-Select Component

Working on a React project in the USA, I often need to give users the option to select multiple values from a list. Whether it’s choosing states, filtering product categories, or selecting skills in a job application form, a multi-select dropdown is one of the most practical components I’ve built and reused over the years. … Read more >>

How to Force a React Component to Re-render

Force a React component to re-render: two counters in Microsoft Edge where changing the key prop resets the child component

To force a React component to re-render (rerender), change its state. In a function component, the usual “forceUpdate” is a reducer that increments a counter: const [, forceUpdate] = useReducer(x => x + 1, 0); call forceUpdate() and the component renders again. Class components have this.forceUpdate() built in. To force a child component to re-render … Read more >>

Build a Custom Input Component in React

Build a Custom Input Component in React

I often find myself working with different technologies beyond just Python. One of the most exciting frameworks I use today is React.js. It allows me to build interactive user interfaces that feel modern and smooth. I needed to create a custom input component in React for a project. The built-in HTML input worked fine, but … Read more >>

React Class Component vs Functional Component

React Class Component vs Functional Component

Recently, I was helping a team of junior developers in New York build a small React dashboard for tracking sales data. Some of them were using class components, while others preferred functional components with hooks. This created confusion, so I decided to walk them through both approaches. In this tutorial, I’ll show you the difference … Read more >>

Pass a Component as a Prop in React

Pass a Component as a Prop in React

As a developer, I was working on a React project where I wanted to reuse the same layout but swap out different components depending on the page. The issue was… I didn’t want to duplicate code or hard-code components into the layout. That’s when I discovered a trick: passing a component as a prop in … Read more >>

Create Tables in React Using react-data-table-component

Tables in React Using react-data-table-component

I was working on a React project where I needed to display a large dataset in a clean and user-friendly way. At first, I thought about building a custom table from scratch, but I quickly realized it would be time-consuming. That’s when I started using react-data-table-component (RDT). It’s lightweight, flexible, and makes table creation in … Read more >>

TypeScript vs JavaScript for React Development

TypeScript vs JavaScript for React Development

When you start a new React project, you might think Should I use JavaScript or try TypeScript? JavaScript is easier to begin with, but TypeScript helps you write cleaner and safer code. Picking the right one can significantly impact how quickly you work, the quality of your code, and the effectiveness of your team collaboration. … Read more >>

Props in React JS

Basic Props Implementation in React JS

When I was working on a React project where I needed to pass data from a parent component to a child component. This is where props come in handy in React. Props (short for properties) are a fundamental concept in React that allows components to communicate with each other. In this article, I will cover … Read more >>

State in React JS

State in React JS useState Hook

As a developer, I was building a React application for a client who needed to track inventory for their small business in Texas. The application needed to update prices, quantities, and product availability in real-time as users interacted with it. The challenge was managing all this changing data efficiently. That’s when I realized the true … Read more >>