解决setstate数据延迟问题引言 示例 setState的参数state和props
众所周知,setstate在存储/改变值的时候是异步的,简而言之就是不会立马生效: const [kind, setKind] = useState<any>([]); const getSelect = () => { axios.get(`${rmpServiceHost}/package/search_conditions`).then((res) => { console.log(kind) setKi