score:0

import React from 'react';

export const ChildComponent = (props) => {
  const callback = () => {
    props.setParentState((prevState) => ({
      ...prevState
      pressed: true,
    }))
  }
  return (
    <button onClick={callback}>test button<button>
  )
}

score:0

const [firstKey, setFirstKey] = useState("");
const [secondKey, setSecondKey] = useState("");

Related Query

More Query from same tag