react 使用new Map()

926 阅读1分钟

const [list,setList] = useState(new Map()) 如果初始化的时候需要赋值给变量则可以直接在useState()括号里面直接付给初始值。

image.png