React onClick and preventDefault() link refresh/redirect?

前端 未结 13 788
生来不讨喜
生来不讨喜 2020-11-30 06:04

I\'m rendering a link with react:

render: ->
  `upvote`

Then, above I hav

13条回答
  •  情话喂你
    2020-11-30 07:07

    none of these methods worked for me, so I just solved this with CSS:

    .upvotes:before {
       content:"";
       float: left;
       width: 100%;
       height: 100%;
       position: absolute;
       left: 0;
       top: 0;
    }
    

提交回复
热议问题