TypeScript, a “superset of JS”, makes it easier to build maintainable, comprehensible, and scalable apps thanks to the power of type-checking.

Generics play an important role in TypeScript as it allows us to write reusable code that accepts both values and types as arguments.

Generics in functions

Generics help us in making our code more reusable. Let’s try to understand what are generics and why do we need them with the help of the below example:

Please note in the above snippet, we have three functions doing pretty much the same thing. It’s duplicated code and screams for making it reusable.

One…


How to use react-hook-form to build clear and maintainable React forms.

React Hook Form represents to me the middle ground between implementations using heavy form libraries, on one side, and cumbersome plain React forms, on the other.

If you’re using a cloud component hub like Bit.dev, to publish and organize your team’s reusable UI components, you’ll find React Hook Form very easy to work with.

Your published UI components should be available for any use. You want them “dumb” and opinionated but still, offer some value for your teammates. By using a hooks-based library, you manage to find that middle ground.


Libraries and tools you should consider for your next React native app setup.

React native has revolutionized the mobile app development process, especially after hybrid mobile app development like Phone-gap, Ionic or other web-based mobile app development.

React Native is not sufficient if your aim is to develop a scalable and maintainable production app. You need to set up the project with various widely used npm packages built by the awesome open source community, which will help in accelerating the development process.

In this post, we will discuss various libraries and tools you should consider for your next React native app setup and I hope this will help you make the decision.

1. React-native base framework

If…


Why build native when you can build a progressive web app?

Progressive web applications (PWAs) solve many of today’s mobile-development issues

In the last few years, there has been exponential growth in the number of mobile phone users. Today, more than 60% of total internet usage is happening via mobile phone.

Obviously, the reasons include portability, cheap hardware, easy access to the internet, and the increased number of services on the internet. With more users on mobile, the optimization of user experience on the phone is essential.

For smaller companies, which often do not have native apps due to cost or time constraints, the web app is the key opportunity for winning customers by providing the best possible experience.

If companies…


It is always healthy for your application to have beautifully crafted APIs

Facebook, Google, GitHub, Netflix, and a few other tech giants have given developers and products a chance to consume their data through APIs and became a platform for them.

Even if you are not writing APIs for other developers and products, it is always very healthy for your application to have beautifully crafted APIs.

There is a long debate going on on the internet about the best ways to design the APIs, and it is one of the most nuanced. There are no official guidelines defined for it.

The API is an interface through which many developers interact with the…


Learn how to get the most out of logging.

Logging is something that every developer has been doing from day 1 of writing code, but very few know the value it can produce and the best practices.
In this post, we will cover the following topics:

  • What are the logs and what is their importance?
  • Best practices to log
  • Important parts of the log
  • Correct usage of log levels
  • Why Winston?

Tip: Optimize teamwork by using the right tools for code-sharing

Use Bit to share, install and collaborate on individual JS modules and UI components. Stop wasting time configuring packages, managing multiple repositories or maintaining cumbersome monorepos.


Learn how to migrate existing REST APIs to GraphQL with Node.js and Express

Given GraphQL is quite a fresher in the realm of software development, a lot of people are not yet confident whether to write the next API in GraphQL or not. Obviously, many of us have been comfortable with REST APIs and have deployed in production with confidence.
In GraphQL there are a lot of open questions like versioning, authentication/authorization, caching, pagination, etc that needs to be answered in detail.

In this series of GraphQL blog posts, I will pick one topic and we will dive deep together.

Tip: optimize your coding by building, sharing and consuming reusable JS components with


Why do I need something better than REST APIs?

What is GraphQL?

GraphQL has nothing to do with ReactJs.

Yes, that’s how I am starting this post, there has been a huge confusion among developers that GraphQL is only for React apps because it was introduced in one of the React conferences.

GraphQL is an application interface (API) just like REST, which is much more powerful and flexible and can be written in pretty much any language.

GraphQL is a Super API with some special powers.

Facebook has been using GraphQL since 2012 internally and later on made it open source. …


Long back when I read about Typescript, I did not welcome it with open arms. I really did not want to explore one more new layer in Javascript world. I will not get surprised if you share that you also got the same feeling about TypeScript.

TypeScript is the missing part of Javascript.

I have enjoyed writing in TypeScript for more than a year and now I feel I am going to struggle without it.

If you are working on any project which you want to maintain for a longer time then you should write in TypeScript.

Tip: Use Bit


An introduction to React 16.7 hooks, with examples.

React is the most powerful UI library. The team is improving performance and the development experience every day by adding amazing features, which ultimately help developers build amazing apps.

If you scrolled twitter last few days, probably you saw most react developers are celebrating the introduction of the awesome feature called Hooks.

Hooks is the new feature which is still in alpha and would be the official part of React 16.7 very soon.

Tip: Use Bit (GitHub) for your components. It will help you organize, share and reuse them between apps to build faster. …

Mahesh Haldar

Full stack Developer at @McKinsey | works @js_channel. Hindi Story teller at https://www.youtube.com/c/eklifafa

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store