Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不断收到一条错误消息,说 setProduct 值不是我的反应代码中的函数。这是我一直在研究的代码框示例。
https://codesandbox.io/s/determined-jang-0ro1v
我不能足够推荐打字稿。的返回值useState是一个数组类型。您需要使用数组语法对其进行解包:const [product, setProduct] = useState()
useState
const [product, setProduct] = useState()