I got stuck on using state hook and keep getting state hook is not a function. Tried restoring all packages and used different syntax not sure what I am missing here. Getting error message setExactPage is not a function. Any help would be appreciated.
const [currentPage, setPrevPage, setNextNext, setExactPage] = useState(0);
const handleFirstProposalPage = () => { setExactPage(1) };
First Page: {currentPage}
Top comments (3)
As Jack says, this hook return only 2 values, a getter prop and a setter function
If you want to manage more than one value, I may recommend you the useReducer hook or something like useSetState hook:
github.com/streamich/react-use/blo...
Use state only returns 2 things: currentPage and setExactPage. The others you'll need to write yourself
Thanks