Welcome to my blog !

Three dots in react components with example|Spread operator

June 25, 2022 ·  4 min read

It is a simple example of three dots(…) in reactjs and JSX. Three dots((…)) in react specify to pass object properties from react components hierarchy. It also updates nested json objects in react application. three dots(…) is also called spread attribute or spread syntax in javascript. It was introduced as part of ES6. You can check my previous tutorial on `Spread operator. What does three dots do? It has different behavior in different scenarios....

How to update ReactJS's `create-react-app`?

June 25, 2022 ·  2 min read

I started to create a react application with the npx create-react-app command and it gives an error You are running create-react-app 4.0.3, which is behind the latest release (5.0.0). It means, My system uses create-react-app with the old version 4.0.4 and the latest version is 5.0.0. It does not create an application, So I have to upgrade to the latest version. here is an output of npx create-react-app command A:\work>npx create-react-app react-style-components Need to install the following packages: create-react-app Ok to proceed?...

Difference between super and super props in React constructor class?

June 25, 2022 ·  3 min read

This tutorial covers the difference between super and super with props parameter in React class constructor. For example, React component defines with super(props) in the the constructor. class PropsExampleComponent extends React.Component { constructor(props) { super(props); } } In this component, super with props defines n the class constructor . class ExampleComponent extends React.Component { constructor(props) { super(); } } Let’s explain the difference between those two components and their differences....

How to check the element index of a list or array in the swift example

June 24, 2022 ·  2 min read

This tutorial explains how to find the index of an element in an array of swift programming languages. Below, Shows the find the index of an element types. primitive array Array of Objects Array provides two methods [firstIndex](https://developer.apple.com/documentation/swift/array/firstindex(of:)) and [lastIndex](https://developer.apple.com/documentation/swift/array/lastindex(where:)) that returns the index position forward iteration and reverse iteration. Both methods return nil if no element is found in an array. How to find the element index for an array of numbers in swift The array contains a list of strings....

How to calculate the sum of all numbers or object values in Array swift with example

June 24, 2022 ·  2 min read

In this tutorial, learn how to find the sum of an array of elements. The array can contain numbers or objects that contain numeric values. Array reduce method that takes an array of elements, and returns a single value. Sum of an array of numbers in Swift with examples The array has a reduce method that reduces the array of elements into a single value. Here is a code example for swift 3 and 4 version...

You'll get a notification every time a post gets published here.