score:1

Accepted answer
const ParentTwo = () => {
  const [error, setError] = useErrorState({
    one: false,
    two: false,
  });
  const setErrorOne = useCallback(() => setError("one"), []);
  const setErrorTwo = useCallback(() => setError("two"), []);
//
  return (
    <>
      <Child setErr={setErrorOne} />
      <Child setErr={setErrorTwo} />
    </>
  );
};

Related Query

More Query from same tag