You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoking instance.destroy() does not unmount the component. As a consequence configured effects are not cleaned up.
This can be seen using the two components from the guide, Uptime and SelfDestruct in the same message.
functionUptime(){const[startTime]=useState(Date.now())const[currentTime,setCurrentTime]=useState(Date.now())useEffect(()=>{constinterval=setInterval(()=>{setCurrentTime(Date.now())},3000)return()=>clearInterval(interval)},[])return<>this message has been shown for {currentTime-startTime}ms</>}exportfunctionSelfDestruct(){constinstance=useInstance()return(<Buttonstyle="danger"label="delete this"onClick={()=>instance.destroy()}/>)}reacord.createChannelMessage(channel).render(<><Uptime/><SelfDestruct/></>)
After the "self destruct" button is clicked the interval trigger keeps on going, repeatedly printing this message in console:
Attempted to update a deactivated message
Tested with React 18.2.0, reacord 0.6.0, and discord.js 14.14.1
The text was updated successfully, but these errors were encountered:
Invoking
instance.destroy()
does not unmount the component. As a consequence configured effects are not cleaned up.This can be seen using the two components from the guide,
Uptime
andSelfDestruct
in the same message.After the "self destruct" button is clicked the interval trigger keeps on going, repeatedly printing this message in console:
Tested with React 18.2.0, reacord 0.6.0, and discord.js 14.14.1
The text was updated successfully, but these errors were encountered: