Easier way to to disable link in React?

前端 未结 7 389
逝去的感伤
逝去的感伤 2021-01-02 04:56

I want to disable Link in some condition:

render() {
    return (
  • {this.props.canClick ? Test
  • 7条回答
    •  一生所求
      2021-01-02 05:54

      I think you should you atrribute to=null to set disable a link.

      
      

      Your code:

      render() {
          return (
    • Test
    • ) }

    提交回复
    热议问题