const assertion1 TIL | Custom hook with return tuple type array ISSUE // 단순 예시입니다. import { useState } from "react"; const useToast = () => { const [isOpen, setIsOpen] = useState(false); const handleToast = () => { setIsOpen((prev) => !prev); }; return [isOpen, handleToast]; }; export default useToast; // error // const handleToast: boolean | (() => void) // This expression is not callable. // Not all constituents of type 'boolean | (() => void)' are.. 2022. 12. 16. 이전 1 다음