79719572

Date: 2025-07-30 07:14:30
Score: 4
Natty:
Report link

@user19685697 I think your question is spot on. You are talking about this right?

//here the function call is not a callback function like: 
//                              onChange={(e)=>updateName(e)}
import React, {useState} from 'react';
 
function MyComponent(){

    const [name, setName] = useState("Robin Hood");

    const updateName = e => setName(e.target.value); //here there is a parameter



    return(
            <>
            <input value={name} onChange={updateName}/> 


            <p>Name: {name}</p>
            </>
    );

}

export default MyComponent
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • User mentioned (1): @user19685697
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: Anjanee Wijewardana