Be yourself; Everyone else is already taken. — Oscar Wilde. This is the first post on my new blog. I’m just getting this new blog going, so stay tuned for more. Subscribe below to get notified when I post new updates.
NPM: install local module
Sometimes we might want to test a local developing module with another local project before merge and release the new version. Here’s the method we could achieve it: Step 1: in module project, execute npm pack: This will build a <package-name>-<version>.tar.gz file. Step 2: refer it in package.json of consumer project: Step 3: Install the package Ref: […]
Everyday Types
Function rendering in React
React Router
V5 Dynamic Routing Routing that takes place as your app is rendering, not in a configuration or convention outside of a running app. Primary Components <BrowserRouter> A <Router> that uses the HTML5 history API (pushState, replaceState and the popstate event) to keep your UI in sync with the URL. Container of other <Route>s. <Route> Its most basic responsibility is to render some […]
Promise
Description A Promise is a proxy for a value not necessarily known when the promise is created. The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. Instead of callback functions, it allows you to associate handlers with an asynchronous action’s eventual success value or failure reason. This lets asynchronous methods return […]
Controlled and uncontrolled components
Introduction Uncontrolled component: self-control controlled component: parent component passes in value and handles change Example 1: A Uncontrolled Component is one that stores its own state internally, and you query the DOM using a ref to find its current value when you need it. This is a bit more like traditional HTML. A Controlled Component is one that takes its current […]
Type narrowing
In TypeScript, type narrowing is the removal of types from a union. To narrow a variable to a specific type, we use the type guard. typeof Return values: Another check for array: Array.isArray() “in” operator JavaScript has an operator for determining if an object has a property with a name: the in operator. instanceof Type Predicates To define […]
time Element
Introduction The <time> HTML element represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders. Attributes datetime
Refresh/Reload Page
Reload Refresh Refs Refresh method
Semantic Versioning
MAJOR.MINOR.PATCH Further: Refs: Semantic Versioning 2.0.0