How to make useEffect only run once on component mount without lying to React?

后端 未结 0 1384
无人及你
无人及你 2020-12-03 00:23

If I want useEffect to only run once on component mount, what is the right way of doing it? Check the following example:

const UseEffectCounter1          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题