// 搜索框
let [kw,setKw]=useState('')
let doKwChange=(e)=>{
let val=e.target.value
setKw(val)
let kwinput=useRef()
let beginSearch=()=>{
console.log('查询搜索',kwinput.current.value)
}
<div className="search clearfloat">
<button type="button" onClick={beginSearch}></button>
<input ref={kwinput} onChange={doKwChange} value={kw} type="text" placeholder='新闻/商品搜索'/>
</div>