React : Use Single Handler to update all input textbox


    const handleUpdateInput = (e) => {
        let key = e.target.name;
        setEmpData({
            ...empData,
            [key]:e.target.value
        })

    }

7 - ES6 Features

- let & const 
- Arrow Functions
- Template literals
- Default Parameter value 
- Spread and rest 
- destructuring  
   const { name } = person;
- object literals 
    let person = { name } // key and value is same 

What is useCallback and Why it's required.


The useCallback hook is used where we have to check the reference equality (i.e functions, callback functions)

where we have normal props check we can user React.Memo ( remember React.Memo is nothing to do with useMemo hook )

useCallback is mainly used when we pass function as callback function in react components


Before Using Callback


const incrementSalary = () => {
   setSalary(salary + 1000 )
}


After Using callback funcation

const incrementSalary = useCallback(() => {
   setSalary(salary + 1000 )
}, [age])