Encountered a link jump problem in react

/ / implement a click jump function

Code:

  constructor(props){
     super(props);
     this.clickFunc = this.clickFunc.bind(this);  
     //ESlintbindjsx
  }


  clickFunc=(url)=>{
      window.location.href = url;
  }

  //render 

  return (
      <div className="linkWrap" onClick={this.clickFunc(url)}>
            //a....
            //
      </div>
  );

question: in this way, the clickFunc method will be executed automatically as soon as the page is loaded, resulting in not seeing the original page. Is there any way that the method will not be executed when instantiated, and the method can be bound?

Mar.05,2021

onClick={() => this.clickFunc(url)}

onClick={this.clickFunc.bind(this,url)}
Menu