react button onClick redirect page

前端 未结 13 2278
我在风中等你
我在风中等你 2020-12-02 15:19

I am working on web application using React and bootstrap. When it comes to applying button onClick, it takes me hard time to let my page being redirect to another. if afte

13条回答
  •  感情败类
    2020-12-02 16:02

    I was also having the trouble to route to a different view using navlink.

    My implementation was as follows and works perfectly;

    
      
    this.props.history.push('/admin/my- settings') } > Settings

    Wrap it with a div, assign the onClick handler to the div. Use the history object to push a new view.

提交回复
热议问题