You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`import { useState, useCallback } from "react"
import { Cookies } from "typescript-cookie"
import { CookieAttributes } from "typescript-cookie/dist/types"
export default function useCookie(name: string, defaultValue: any | undefined) {
const [value, setValue] = useState(() => {
const cookie = Cookies.get(name)
if (cookie) return cookie
Cookies.set(name, defaultValue)
return defaultValue
})
When I try using useCoookie with typescript I get errors when it returns a null value for newValue.
Any idea what would be causing this?
The text was updated successfully, but these errors were encountered: