npm / react-cookie
react-cookie
What changed in react-cookie 4 to 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-12.
4 breaking1 security5 new APIs and options2 performance5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-cookie 86 changes
Security 1
Patches dependency vulnerabilities.
New APIs and options 1
Adds a method to remove all change listeners.
Fixes and other changes 4
Drops Node-only types from universal-cookie.
Uses an isomorphic layout effect to suppress the SSR warning.
Fixed types for the React provider.
Adds detection for when a provider is missing.
react-cookie 71 changes
Breaking changes 1
Importing files from a subfolder is no longer supported because the output file structure changed.
react-cookie 67 changes
Breaking changes 3
All JavaScript types are now serialized in JSON, except strings.
The undocumented decode function is no longer supported in universal-cookie.
The undocumented encode function is no longer supported in universal-cookie.
New APIs and options 4
defaultSetOptions has been added to Cookies in universal-cookie.
The defaultSetOptions prop has been added to CookiesProvider in react-cookie.
universal-cookie adds update so cookies can be updated after they are changed by the server.
updateCookies has been added to useCookies in react-cookie.
react-cookie 43 changes
Performance 2
Memoized so its reference does not change unnecessarily.
Memoized so its reference does not change unnecessarily.
Fixes and other changes 1
Restored its original type.