Shyam Hande has Published 46 Articles

Creating a Node.js server

Shyam Hande

Shyam Hande

Updated on 13-May-2020 11:17:53

640 Views

The mostly used core modules of Node.js are −http − used to launch a simple server, send requestshttps − used to launch a ssl secured http serverpath − used to handle path based on operating systemfs − It’s a file system handling moduleos − its used for os related operationsLets ... Read More

Fragment in React.js

Shyam Hande

Shyam Hande

Updated on 05-Sep-2019 07:48:28

549 Views

Most of the times we need to return multiple elements from a component. React Fragment helps in returning multiple elements. The other alternative is to use a html element like div to wrap them. But using extra html node can cause some semantic issues.Example of React.Fragmentrender() {    return ( ... Read More

React.js stateless vs stateful

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 14:49:37

5K+ Views

Understand the difference in stateless and stateful react componentsIn state management post, we learned how we can handle state in react if something is changed.Stateless components are simple functional component without having a local state but remember there is a hook in react to add state behavior in functional component ... Read More

Context api in React.js

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 14:41:40

998 Views

The React context api is safe to use in production with the version 16.3 or latest. The reason for adding context api is to avoid the passing of props if there is a chain of children components.Without the use of context api, we have to pass the props through all ... Read More

Why need build workflow in React.js

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 14:34:28

790 Views

BUILDING A WORK-FLOW HELPS IN DOING BELOW THINGSIt optimizes codeUsing next-gen JavaScript (ES6)Its a standard way for single/multiple page appsProductive approachEasy integration of dependencies with NPM or YarnUse of bundler like web-pack for easier modular code and shipping codePre compiler like BabelWe can use a local development server to test ... Read More

Using useState hook in React.js

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 14:24:52

653 Views

Hooks allows the functional component in react to get the features available in class based component in make them more powerful.useState we will import from react. Import {useState} from ‘react’; This helps us in creating local state variables for functional component and provides method to update that variable.State in class ... Read More

Promises Callbacks And Async/Await

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 14:03:41

1K+ Views

First we have to understand two main conceptsSynchronous programmingAsynchronous programmingSYNCHRONOUS PROGRAMMINGIt waits for each statement to complete its execution before going to next statement.This approach can slow down application process if statements are not dependent on each other but still they are waiting for execution as they are in queue.ASYNCHRONOUS ... Read More

Returning adjacent element in React.js and HOC

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 13:16:01

336 Views

Generally the return statement in React’s render method returns a single div element enclosing all the child jsx like below −render(){    return (                Header          Test          ); }Here we cannot simply return multiple ... Read More

React.js routing

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 13:00:52

2K+ Views

Before React Router v4, the routing in react was static but after v4 update its dynamic. In single page applications, we have only one page index.html and different components which gets displayed based on routes.In non spa web applications, server returns a page on request. To start with routing , ... Read More

React.js component lifecycle error handling phase

Shyam Hande

Shyam Hande

Updated on 04-Sep-2019 12:56:01

902 Views

There are two main methods in error handling. These method are used in the error boundary mechanism in React. We wrap the component ( from where there is a possibility of error occurrences ) in a class which handles the below methods.Static method getDerivedStateFromError(error)componentDidCatch(error, info)Static getDerivedStateFromError(error): As name of the ... Read More

Advertisements