Writing Effective Unit Tests with React and Enzyme

UNIT TESTING is a type of software testing where individual units or components of the software are tested. with this method of testing, both testers and developers can isolate each module, identity, and fix the system defects at the very early stage of the software development lifecycle(SDLC). Unit test is solely performed by developers. Why… Continue reading Writing Effective Unit Tests with React and Enzyme

Using tableLayout CSS property with TypeScript

Using table-layout property with React and TypeScript was giving a type error like below: ERROR in /var/jenkins/workspace/dev/resources/packages/sites/table.tsx [tsl] ERROR in /var/jenkins/workspace/dev/resources/packages/sites/table.tsx(79,25) TS2322: Type ‘{ padding: number; width: string; margin: string; tableLayout: string; }’ is not assignable to type ‘CSSProperties’. Types of property ‘tableLayout’ are incompatible. Type ‘string’ is not assignable to type ‘TableLayout’. This was… Continue reading Using tableLayout CSS property with TypeScript

CSS Flip Animation for Font Awesome Icons

This flip animation will be a perfect use-case for enable/disable UI actions. We’ll be using rotateY transform function to achieve this flip animation. Here is a simple HTML page with a few font awesome icons in both enabled and disabled states (we’ll be adding CSS for these states later) and jquery included for click actions.… Continue reading CSS Flip Animation for Font Awesome Icons

React – Render String with HTML tags as HTML

There are often times when you have a string with some HTML tags such as strong that you want to render as HTML on the DOM. Most solutions online recommend using dangerouslySetInnerHTML but that is dangerous as the name suggests. The proper way to render HTML from string is to use FormattedMessage from the formatjs… Continue reading React – Render String with HTML tags as HTML

How to run an HTML file?

Many modern editors are available to create and modify web pages. But we recommend using simple editors like Notepad (windows) and Textedit (Mac). How to open Notepad in windows? Open start and type notepad at search. (OR) Open Start > Programs > Accessories > Notepad. How to open Textedit in Mac? press command + space enter Spotlight search will appear… Continue reading How to run an HTML file?

React: How to use Apollo with ‘Union Types’ in GraphQL

Apollo is one of the most popular React library to work with GraphQL APIs. However they don’t have native support when your APIs contain union types. Let’s look at an example API that contains union types and how we can work with them using Apollo. Assuming you have an API like this: that returns this… Continue reading React: How to use Apollo with ‘Union Types’ in GraphQL

Published
Categorized as React Tagged

How to become a web developer

Everyone who wants to become a web developer must know basic HTML, CSS, and Javascript. Our posts will help you to learn Web development from Beginners to Master Level. No prior knowledge required. HTML is the skeleton of the webpage. CSS is the muscle and skin that covers the skeleton and makes it beautiful. Javascript… Continue reading How to become a web developer