react 使用new Map() wu吼喉 2022-11-24 926 阅读1分钟 const [list,setList] = useState(new Map()) 如果初始化的时候需要赋值给变量则可以直接在useState()括号里面直接付给初始值。