score:4

Accepted answer
function MyFormComponent ({onFieldChange}) {

  const handler = ({target: {name, value}}) => onFieldChange(name, value);

  return (
    <div>
      <input name="title" value={formState.title} onChange={handler} />
      <input name="bio" value={formState.bio} onChange={handler} />
      <input name="expertise" value={formState.expertise} onChange={handler} />
    </div>
  );
}

Related Query

More Query from same tag