How to update object state with react useState()

To update a state in React is a very simple process using react hooks - useState. Check the code below: Update simple state // import useState hook import React, {useState} from 'react'; //create and export the component export default function MyName(){...

How to run useEffect() only once | React Hooks

Just add an empty array after the callback function separated by a comma useEffect(callback, []); useEffect(()=>{}, []); And if you get any warning for missing dependency, add that inside the array useEffect(()=>{ // your code here }, [dependency_item]); If the...

Get started with Create React App

Create a react app with Zero build configuration on your local machine. Please ensure that you have Nodejs installed on your machine Step 1: Open your terminial run this command npx create-react-app my-app This will install all the necessary codes to your device. Here...