react e.target.lastChild is null

前端 未结 0 1660
心在旅途
心在旅途 2021-01-14 10:54

I guess the syntax is fine so why is it telling me cannot change the style of null?

onClick={e=>e.target.lastChild.style.background = "black"}

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