You're welcome & thank you for taking time for the reply, as it means much to me :)
As aside note, using hooks, a similar way is to accomplish is to use useEffect (as you do for componentDidUpdate).
e.g.)
functionApp(){const[name,setName]=useState(undefined);useEffect(()=>{constfetchName=async()=>{constremoteName=await(awaitfetch("...")).json();// remoteName => 'André'setName(remoteName);};fetchName();// At this point, name is still "undefined", not "André"console.log(name);},[]);useEffect(()=>{// You can skip your process, when the name is not yet set.if(name===undefined)return;// At this point, the name is "André"console.log(name);},[name]);// return ...}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Welcome to DEV André 👋.
You're welcome & thank you for taking time for the reply, as it means much to me :)
As aside note, using hooks, a similar way is to accomplish is to use
useEffect
(as you do forcomponentDidUpdate
).e.g.)