score:0

i'm not sure but try this :

first update this line in the parent component :

if (userdata.me.id !== notedata.note.author.id) {
    return navigate(`/note/${id}`, { replace: true });
 }

then in the child component i would like to do this :

const noteform = ({content = "", action}) => {
    const [value, setvalue] = usestate(content);

    const onchange = event => {
        setvalue(event.target.value);
    };
.....

// then in the render of text area we only need a flat state contains value

<textarea
  required
  type="text"
  name="content"
  placeholder="note content"
  value={value}
  onchange={onchange}
/>

but if it doesn't work , try to set the state inside useeffect based on the value of content, dont't forget to give the state an initial value "":

useeffect(() => {
   if (content) {
     setvalue(content);
   }
}, [content]);

Related Query

More Query from same tag