score:1

there has to someplace where i have to check saying "hey if the props have changed, reset the state with the new props for edit???

yes you can use react.useeffect hook on the special prop or array of props, then when that/those prop(s) change the internal hook function will be fire.

e.g. :

const mycomponent = (props) => {
  let [mystate,setmystate]= react.usestate(null);

  react.useeffect(()=>{
    setmystate(props.prop1);
  },[props.prop1]);

  return ...
}

Related Query

More Query from same tag