![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
React
weixin_38122772
世上本无事,庸人自扰之~
展开
-
用React hook写一个倒计时
import React, { useState, useEffect, useCallback, useRef } from 'react'; const CountDown: React.FC = () => { const intervalRef = useRef<any>(null); const [count, changeCount] = useState(0); useEffect(() => { if (count === 59) {原创 2020-06-16 14:17:15 · 3965 阅读 · 0 评论 -
react 获取实例的方法 (ref / wrappedComponentRef / getWrappedInstance)
普通组件 child1.js import React, { PureComponent } from 'react'; export default class Child1 extends PureComponent { state = { name: 'child1111' } render(){ return ( <div> ...原创 2019-07-16 18:27:25 · 9761 阅读 · 3 评论