Nothing here yet.
Nothing here yet.
No blogs yet.
In this case, <App/> should be the component that manages the state so that <MyForm/> uses it as props. Something like this: const [firstName, setFirsName] = React.useState( "Arun" ); const [lastName, setLastName] = React.useState( "Kumar" ); // you'll need to define some event handlers to change the values // the form component will use these const handleSubmit = e => { e.preventDefault(); // do whatever you need to do with the values console .log( "firstName" , firstName); console .log( "lastName" , lastName); } return ( < div > < MyForm fname = {firstName} lname = {lastName} onSubmit = {handleSubmit} /> </ div > ) ;