How can I make react-bootstrap's Dropdown open on mouse hover?

后端 未结 7 1796
-上瘾入骨i
-上瘾入骨i 2020-12-15 19:40

Ok the question is simple. I need to make the dropdown open when mouse hover rather than on click.

Currently my code is as follow.

    
7条回答
  •  天命终不由人
    2020-12-15 19:55

    export class Nav extends React.Component {
    
      constructor(props) {
        super(props)
        this.state = { isOpen: false }
      }
    
      handleOpen = () => {
        this.setState({ isOpen: true })
      }
    
      handleClose = () => {
         this.setState({ isOpen: false })
      }
    
      render() {
        return (
           
        )
      }
    }
    

    Hope this solves your issue.

提交回复
热议问题