React Hook 写 Timer时钟
import React, {useState, useEffect} from 'react'const Timer = ({options}) => {const [date, setDate] = useState(new Date())useEffect(() => {const tick = () => setDate(new Date())const timerId = setTimeout(tick, 1000)// 返回一个清除函数, 清