【发布时间】:2020-10-16 14:35:44
【问题描述】:
在大多数情况下,哪一个是最佳实践?
例如:
const [currentDaypart, setCurrentDaypart] = useState({})
const [nextDaypart, setNextDaypart] = useState({})
或
const [daypart, setDaypart] = useState({
current: {},
next: {}
})
??????
【问题讨论】:
-
这能回答你的问题吗? React Hooks and the use of useState
标签: reactjs react-hooks react-component react-functional-component