this.refs.something returns “undefined”

前端 未结 6 1680
野趣味
野趣味 2020-12-08 03:52

I have an element with a ref that is defined and ends up getting rendered into the page :

    
... <
6条回答
  •  一向
    一向 (楼主)
    2020-12-08 04:30

    Instead of putting your Console.log inside the function example(){...} you should put it inside:

    example=()=>{....}
    

提交回复
热议问题