REACT - toggle class onclick

后端 未结 14 1973
长情又很酷
长情又很酷 2020-11-27 11:40

I am trying to figure out how to toggle an active class onClick to change CSS properties.

I have taken many approaches, and read many SO answers. Using

14条回答
  •  半阙折子戏
    2020-11-27 12:07

    The above answers will work, but just in case you want a different approach, try classname: https://github.com/JedWatson/classnames

提交回复
热议问题