Structs in Solidity

Struct is user-defined/custom data type where you can define some arbitrary object with some properties. You can't return the struct directly, but can return a tuple of its properties. // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; contract HelloWorld { // struct is user-defined/custom data type where you…

Using useReducer React Hook

The useReducer hook allows you to use a reducer for state management in your application. A reducer, of course, is simply a pure function that takes an action and state, and returns a copy of that state after applying the action on that state.…

Using useEffect Hook In React

The useEffect hook behaves similar to componentDidMount, componentDidUpdate, and componentWillUnmount lifecycle hooks combined. It allows you to perform any (side)effects, such as API calls, without blocking the UI render.…