我對 Preact 很陌生,當我想在 Preact 中使用鉤子時,我收到一個錯誤:Uncaught TypeError: Object(...) is not a function而且我不知道該怎么做,網上有一些關于 Preact 的文章這是我的代碼import './style';import { useState } from 'preact';function App() { const [value, setValue] = useState(0); const increment = useCallback(() => setValue(value + 1), [value]); return ( <div> Counter: {value} <button onClick={increment}>Increment</button> </div> );}export default App
Uncaught TypeError: Object (...) is not a function
30秒到達戰場
2022-01-20 20:45:12