Reactjs: page refreshing upon `onClick` handle of Button?

前端 未结 4 1925
旧巷少年郎
旧巷少年郎 2021-01-02 00:30

I have the following block inside my render() (which is a Bootstrap Button: https://react-bootstrap.github.io/components.html#buttons-options):

&         


        
4条回答
  •  [愿得一人]
    2021-01-02 00:36

    You can prevent the default behavior as suggested by zerkms or

    Just add type="button" in button tag.

    Eg: this.showSomething('all')}>All

提交回复
热议问题