Subscribe on changes!

tsx Functional components use a life cycle

avatar
Jul 13th 2021
const temp= () => {
    const updateTime = (date: Date) => dateTransform(date, 'YYYY-MM-DD hh:mm:ss')
    const time = ref(updateTime(new Date()))
    let timer: any = null
    timer = setInterval(() => {
        time.value = updateTime(new Date())
    }, 1000)

    onUnmounted(() => {
        
        clearInterval(timer)
    })
    return (
        <>
            <div class={Header.time}>{time.value}</div>
        </>
    )
}
avatar
Jul 13th 2021

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!