How do I call the blur () method of the Select component in ant design?

Jun.15,2022

import React, { Component, Fragment } from 'react'
import { Select, Button } from 'antd'

const Option = Select.Option

export default class SelBtn extends Component {
  constructor (props) {
    super(props)
    this.myRef = React.createRef()
  }

  selBlur = () => {
    this.myRef.current.blur()
  }

  render () {
    return <Fragment>
        <Select ref={this.myRef} style={{width: 300}}>
          <Option value="jack">Jack</Option>
          <Option value="lucy">Lucy</Option>
        </Select>
        <Button onClick={this.selBlur}>blur</Button>
    </Fragment>
  }
}

Note:
createRef () method requires React v16.3 or above
if the react version is lower than 16.3, use ref callback to get ref.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e7760f-651.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e7760f-651.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?